Skip to content

re-use cmlxc workflow, replacing CI with hetzner staging servers with local lxc containers#917

Open
hpk42 wants to merge 1 commit intomainfrom
hpk/new-lxc-test
Open

re-use cmlxc workflow, replacing CI with hetzner staging servers with local lxc containers#917
hpk42 wants to merge 1 commit intomainfrom
hpk/new-lxc-test

Conversation

@hpk42
Copy link
Copy Markdown
Contributor

@hpk42 hpk42 commented Apr 12, 2026

cmlxc is meanwhile regularly published (via the https://github.com/chatmail/cmlxc repo) via an OIDC-automated github workflow (which means anyone with write rights can create a new release, see README):

https://pypi.org/project/cmlxc/

The chatmail/cmlxc repo also offers a re-usable "lxc-test" workflow that is used here in this PR, to replace the staging-* hetzner host testing with testing against local containers. The "cmlxc" commands executed in the github CI should be possible to run unmodified locally to recreate any problems.

i think it would be sufficient to only daily deploy to "real" servers, maybe laso doing the docker tests there. It is not neccessary for each commit in a PR to cause the whole remote dance and dependency (if something fails in staging, it's not easy to replicate locally).

A sister PR is also in the madmail repo, also re-using the same lxc-test workflow.

sidenote: The "chatmail/cmlxc" is still incrementally developing, although i think i finished the largest refactorings i wanted to do. I'll see to give a sign when i feel the code base is sufficiently stable, and worth a more thorough review. Meanwhile PRs or issue-filing ist welcome.

@hpk42 hpk42 force-pushed the hpk/new-lxc-test branch 4 times, most recently from 7ea8cfd to 51b930a Compare April 13, 2026 14:47
@hpk42 hpk42 changed the title WIP: try re-use cmlxc workflow from chatmail/cmlxc to perform testing re-use cmlxc workflow from chatmail/cmlxc to replace testing with hetzner staging servers with local containers Apr 15, 2026
@hpk42 hpk42 changed the title re-use cmlxc workflow from chatmail/cmlxc to replace testing with hetzner staging servers with local containers re-use cmlxc workflow, replacing CI with hetzner staging servers with local lxc containers Apr 15, 2026
@hpk42 hpk42 force-pushed the hpk/new-lxc-test branch from 51b930a to 7439976 Compare April 15, 2026 17:13
Comment thread .github/workflows/ci.yaml Outdated
Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml
Comment on lines +45 to +51
cmlxc_commands: |
cmlxc init
cmlxc deploy-cmdeploy --source ./repo -vv cm0
cmlxc test-mini cm0
cmlxc test-cmdeploy -vv cm0
cmlxc deploy-cmdeploy --source ./repo -vv --ipv4-only cm1
cmlxc test-cmdeploy -vv cm0 cm1
Copy link
Copy Markdown
Contributor

@missytake missytake Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start :) I wonder whether the deploys could maybe run concurrently to speed this up a bit - but we should first gather some experience with this new workflow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests are generally very fast, it's the deploys that are slow -- they could run concurrently against several hosts but then the option-handling gets more complex. for now it's simpler, and more helpful for logging and debugging any issues, to run things sequentially.

Comment on lines -32 to -42
# save previous acme & dkim state
rsync -avz root@staging-ipv4.testrun.org:/var/lib/acme acme-ipv4 || true
rsync -avz root@staging-ipv4.testrun.org:/etc/dkimkeys dkimkeys-ipv4 || true
# store previous acme & dkim state on ns.testrun.org, if it contains useful certs
if [ -f dkimkeys-ipv4/dkimkeys/opendkim.private ]; then rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" dkimkeys-ipv4 root@ns.testrun.org:/tmp/ || true; fi
if [ "$(ls -A acme-ipv4/acme/certs)" ]; then rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" acme-ipv4 root@ns.testrun.org:/tmp/ || true; fi
# make sure CAA record isn't set
scp -o StrictHostKeyChecking=accept-new .github/workflows/staging-ipv4.testrun.org-default.zone root@ns.testrun.org:/etc/nsd/staging-ipv4.testrun.org.zone
ssh root@ns.testrun.org sed -i '/CAA/d' /etc/nsd/staging-ipv4.testrun.org.zone
ssh root@ns.testrun.org nsd-checkzone staging-ipv4.testrun.org /etc/nsd/staging-ipv4.testrun.org.zone
ssh root@ns.testrun.org systemctl reload nsd
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngl, I'm going to miss this caching logic a little bit.

@hpk42 hpk42 force-pushed the hpk/new-lxc-test branch from 3ec2c7f to 166f50c Compare April 16, 2026 08:25
Copy link
Copy Markdown
Contributor

@j4n j4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could not test much; I suppose this will mean ci-testing locally and then having a nightly run of the old-fashioned non-local testing?

Comment thread .github/workflows/ci.yaml
@@ -1,15 +1,26 @@
name: CI
name: Run unit-tests and container-based deploy+test verification
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: Run unit-tests and container-based deploy+test verification
name: CI: unit tests + LXC deploy

So its always visible in UI

Comment thread .github/workflows/ci.yaml
on:
pull_request:
# Triggers when a PR is merged into main or a direct push occurs
push:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should bring back excluding the non-code files:

paths-ignore:
- 'scripts/**'
- '**/README.md'
- 'CHANGELOG.md'
- 'LICENSE'

Copy link
Copy Markdown
Contributor

@missytake missytake Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget doc/** ;)

@hpk42 hpk42 force-pushed the hpk/new-lxc-test branch 3 times, most recently from cd9d4df to 096acf3 Compare April 16, 2026 17:25
@hpk42 hpk42 force-pushed the hpk/new-lxc-test branch from 096acf3 to 7008ae8 Compare April 16, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants