ReleaseMe CI States, Help, Git

Since we recently wired up the KDE release tool releaseme with KDE neon’s git-build technology I had the opportunity to spend some quality time on the code and managed to sneak in a load of both quality and speed improvements as well as some new features.

CI States

For quite a while I’ve been considering to pull CI data into releaseme. It makes all sorts of sense. You want to release high-quality software, so whenever possible you’d want to make sure CI is green. But to do that you’d have to open a browser, navigate to build.kde.org, and find the right jobs. Yet, there is absolutely no reason why a human would have to do that. So now releaseme does it for you before getting started on assembling the sources.

Help

Unfortunately, the release process itself is often a bit convoluted and it is not clear what to do once you have a tarball. To help people with publishing their new tarball releaseme will now print a handy help suggesting common steps to take once you have a tarball. It also points to the relevant location for publishing tarballs on KDE infrastructure and even gives you a handy link with a sysadmin ticket template to quickly file a publishing request.

Git Builds

Aleix Pol worked on adding a cool new feature to the extra-cmake-modules frameworks, enabling everyone who builds from git to fetch translations as well. This is currently slated to release with KDE Frameworks 5.34. Once landed you’ll be able to run make fetch-translations with just about any git clone of KDE software and grab the latest translations into your build directory.

Advertisements

KDE neon With Testing Translations

For the longest time, the plan was to equip KDE neon’s Developer Editions with translations. As the Developer Editions are built directly from our Git repositories and we do not maintain translations alongside the source code, there is a bit of a problem as the build somehow needs to bridge the gap between code and translations.

It’s fortunate that I also happen to work on ReleaseMe, a KDE tarball release application, and rebuilt it from scratch years ago already, so it supports third party usage of some of its functionality.

At this year’s FOSDEM, Plasma developer David Edmundson asked for translations in the Developer Editions. And, so, here we are. Both KDE neon Developer Editions now include translations live from our Subversion repository. They also include our x-test language allowing you to easily find improperly internationalized strings. Coverage is currently limited to KDE Frameworks and Plasma software.

The majority of tech to accomplish this is hidden in the internals of ReleaseMe itself. On the high-level this entails nothing more than resolving the KDE project and then getting its translations into the Git tree.

projects = ReleaseMe::Project.from_repo_url(url)
unless projects.size == 1
  raise "failed to resolve project #{repo_name} :: #{projects}"
end
project = projects[0]

l10n = ReleaseMe::L10n.new(l10n_origin, project.identifier,
project.i18n_path)
l10n.default_excluded_languages = [] # Include even x-test.
l10n.get(Dir.pwd)

(Underneath there’s, of course, lots of fiddly nonsense going on ;))

Enjoy!

Aptly Systemd Socket Activation

In the previous blog post I talked about Unix domain socket enablement in Aptly, a very popular deb repository management solution. In addition to adding socket support, I’ve also added support for systemd socket activation.

Systemd’s socket activation is an inordinately fancy feature of systemd where it will take over socket creation and management before the actual service is running. It ensures that incoming requests aren’t lost if the service crashes or isn’t started yet. When one has the opportunity to use systemd, letting it do socket activation for Aptly is super handy as it also gives easy access to chown capabilities.

Using socket activation requires you to create two systemd units. A service unit, describing the aptly service itself, and a socket unit, for listening for traffic. Examples files may look like this:

# aptly.service
[Unit]
Description=Aptly archive service

[Service]
ExecStart=/home/archive/bin/aptly api serve
WorkingDirectory=/home/archive
Restart=always
# aptly.socket
[Unit]
Description=Aptly archive service socket

[Socket]
ListenStream=/home/archive/aptly.sock
SocketMode=0660
SocketUser=archive
SocketGroup=archivesocket

[Install]
WantedBy=sockets.target

Enabling and starting the socket unit will create the socket file at /home/archive/aptly.sock and start the service upon incoming traffic, which you could cause, for example, using curl --unix-socket /home/archive/aptly.sock http:/api/version.

Fairly exciting already. But if you’ve previously been listening on a TCP port you may wish to establish a smoother migration path without having to change your entire infrastructure to work with sockets all at once. Aptly however only supports listening on one socket, so you can’t just have it listen on both a TCP socket and a unix socket. Fortunately, systemd also has a neat solution for this, called systemd-socket-proxyd. Using the socket activation systemd itself can proxy traffic from a TCP socket to our new aptly socket file.

Again example units for illustration:

# aptly-proxy.service
[Unit]
Description=Aptly Socket (Proxy Listener)

[Service]
ExecStart=/lib/systemd/systemd-socket-proxyd /home/archive/aptly.sock
PrivateTmp=yes
# aptly-proxy.socket
[Unit]
Description=Aptly Socket (Proxy Listener)
After=aptly.socket

[Socket]
ListenStream=127.0.0.1:8080

[Install]
WantedBy=sockets.target

When enabling and starting this socket unit systemd will listen on 127.0.0.1:8080 for traffic and proxy it through systemd-socket-proxyd to our actual Aptly socket file. At this point Aptly will be able to receive traffic from both the unix socket and the TCP socket (although of course effectively Aptly is only listening on the unix socket).

Now if only systemd could play audio it’d be quite the bundle of usefulness 😉