Skip to content

Schedule daily cleanup of playground VMs

bin/playground-vm cleanup will destroy playground VMs corresponding to closed MRs, and it's useful to schedule a daily run or it, to make sure VMs aren't accidentally left around to run forever, consuming credits.

Directions from Helmut:

Server tasks can be used as infrastructure to schedule this.

https://gitlab.com/freexian/sysadmin/server-tasks/ is the repo where the task configuration needs to go: you get to create a directory for the playground management there and that directory needs to contain a file called servertasks.yaml

The structure of that yaml is https://salsa.debian.org/freexian-team/ansible/debian-infrastructure/-/blob/main/roles/servertasks/files/servertasks.py?ref_type=heads#L44

Credentials (such as cloud and dns tokens) will be installed as systemd-creds and passed into the nspawn container running the task.

Note that the credential namespace is relatively global, so one needs to use names that are unique in a freexian context

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information