Enrico Zini: Assembling the custom runner
This post is part of a series about trying to setup a gitlab runner based on
systemd-nspawn. I published the polished
result as nspawn-runner on GitHub.
The plan
Back to custom runners, here's my plan:
Trying out the plan
I tried a manual invocation of
Deploy
The remaining step is to deploy all this in
Next steps
My next step will be polishing all this in a
way that makes deploying and maintaining a runner configuration easy.
configcan be a nooppreparestarts the nspawn machinerunruns scripts withmachinectl shellcleanuprunsmachinectl stop
base.sh with definitions sourced by all scripts:
MACHINE="run-$CUSTOM_ENV_CI_JOB_ID" ROOTFS="/var/lib/gitlab-runner-custom-chroots/buster" OVERLAY="/var/lib/gitlab-runner-custom-chroots/$MACHINE"
config.sh doing nothing:
#!/bin/sh exit 0
prepare.sh starting the machine:
#!/bin/bash source $(dirname "$0")/base.sh set -eo pipefail # trap errors as a CI system failure trap "exit $SYSTEM_FAILURE_EXIT_CODE" ERR logger "gitlab CI: preparing $MACHINE" mkdir -p $OVERLAY systemd-run \ -p 'KillMode=mixed' \ -p 'Type=notify' \ -p 'RestartForceExitStatus=133' \ -p 'SuccessExitStatus=133' \ -p 'Slice=machine.slice' \ -p 'Delegate=yes' \ -p 'TasksMax=16384' \ -p 'WatchdogSec=3min' \ systemd-nspawn --quiet -D $ROOTFS \ --overlay="$ROOTFS:$OVERLAY:/" --machine="$MACHINE" --boot --notify-ready=yes
run.sh running the provided scripts in the machine:
#!/bin/bash logger "gitlab CI: running $@" source $(dirname "$0")/base.sh set -eo pipefail trap "exit $SYSTEM_FAILURE_EXIT_CODE" ERR systemd-run --quiet --pipe --wait --machine="$MACHINE" /bin/bash < "$1"
cleanup.sh stopping the machine and removing the writable overlay directory:
#!/bin/bash logger "gitlab CI: cleanup $@" source $(dirname "$0")/base.sh machinectl stop "$MACHINE" rm -rf $OVERLAY
gitlab-runner, and it worked perfectly:
# mkdir /var/lib/gitlab-runner-custom-chroots/build/
# mkdir /var/lib/gitlab-runner-custom-chroots/cache/
# gitlab-runner exec custom \
--builds-dir /var/lib/gitlab-runner-custom-chroots/build/ \
--cache-dir /var/lib/gitlab-runner-custom-chroots/cache/ \
--custom-config-exec /var/lib/gitlab-runner-custom-chroots/config.sh \
--custom-prepare-exec /var/lib/gitlab-runner-custom-chroots/prepare.sh \
--custom-run-exec /var/lib/gitlab-runner-custom-chroots/run.sh \
--custom-cleanup-exec /var/lib/gitlab-runner-custom-chroots/cleanup.sh \
tests
Runtime platform arch=amd64 os=linux pid=18662 revision=775dd39d version=13.8.0
Running with gitlab-runner 13.8.0 (775dd39d)
Preparing the "custom" executor
Using Custom executor...
Running as unit: run-r1be98e274224456184cbdefc0690bc71.service
executor not supported job=1 project=0 referee=metrics
Preparing environment
Getting source from Git repository
Executing "step_script" stage of the job script
WARNING: Starting with version 14.0 the 'build_script' stage will be replaced with 'step_script': https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26426
Job succeeded
/etc/gitlab-runner/config.toml:
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "nspawn runner"
url = "http://gitlab.siweb.local/"
token = " "
executor = "custom"
builds_dir = "/var/lib/gitlab-runner-custom-chroots/build/"
cache_dir = "/var/lib/gitlab-runner-custom-chroots/cache/"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.custom]
config_exec = "/var/lib/gitlab-runner-custom-chroots/config.sh"
config_exec_timeout = 200
prepare_exec = "/var/lib/gitlab-runner-custom-chroots/prepare.sh"
prepare_exec_timeout = 200
run_exec = "/var/lib/gitlab-runner-custom-chroots/run.sh"
cleanup_exec = "/var/lib/gitlab-runner-custom-chroots/cleanup.sh"
cleanup_exec_timeout = 200
graceful_kill_timeout = 200
force_kill_timeout = 200
Today, we are pleased to announce that
... isn't ready yet, but it's getting there.
I had planned to release a new version of SReview, my online video review and
transcoding system that I wrote originally for FOSDEM but is being used for
DebConf, too, after it was set up and running properly for FOSDEM 2020.
However, things got a bit busy (both in my personal life and in the world at
large), so it fell a bit by the wayside.
I've now also been working on things a bit more, in preparation for an
improved administrator's interface, and have started implementing a REST
API to deal with talks etc through HTTP calls. This seems to be coming
along nicely, thanks to

Yesterday was our monthly Debian meeting.
We do one every month for Tokyo and Kansai combined, because it's online and no reason to split for now.
I presented what I learnt about nodejs packaging in Debian.
This time, I started using Emacs for presentation, presenting PDF file.
This week I switched most of my login shells to emacsclient, and
experimenting. It's interesting how much things break, and
how much I depended on .bashrc and .profile being loaded.
But most things work and I don't need most things outside of emacs...
There are ton of articles out there to configure mutt and all related
things to it. But I find certain configs very hard to get. So I will
write down those.

As a reader of
There is no denying in the fact that 2020 was a challenging year for everybody, including animals.
In India, animals such as dogs who mostly filled their bellies at street food stalls, were starving as there were no street eateries operating during a long long lockdown. I was in my home town, New Delhi, working from home like most of us.
During the month of July 2020, a dog near the place I live (we fondly called her Brownie) delivered 7 pups in wilderness.
I would never forget my first sight of them, inside a dirty, garbage filled land there were the cutest, cleanest, tiniest ball of fur! All of them were toppled as the land s surface was uneven.. The first instinct was to put them all together on a flat surface. After the search mission completed, this was the sight..
Brownie and her litter put together in the same land where she gave birth.


The adorable, Robin !
Don and his new big brother!
The naughty and handsome, Swayze !
First Pup who got adopted Pluto
Playful and Beautiful, Bella !








Brownie, the mom dog!
This is a puppy!
She did not let us put coat on her 
When I see them now, healthier, happier, running around, with no fear of getting attacked by dogs, I can t express the content I feel. For 2 of the dogs (Brownie and her friend) I got it done personally from a private vet. For the other 3, I got it done via Municipal Corporations who do it for free for dogs, you d have to call them and they come with dog catchers and a van and drop them back in the same area, but volunteers like us have to be very vigilant and active during the whole process to follow up with them.
Dogs getting dropped off after sterilization.