Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spread, tests: add adhoc backend using LXD VMs [RFC] #14875

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bboozzoo
Copy link
Contributor

A little skunkworks project which adds an adhoc backend using LXD to allocate VMs on demand. Hopefully will be replaced with native support in spread once canonical/spread#185 lands.

It can even run ubuntu-core tests, though much faster than with GCP:

2024-12-18 14:20:18 Found /home/maciek/work/canonical/snapd/spread.yaml.
2024-12-18 14:20:54 Project content is packed for delivery (175.81MB).
2024-12-18 14:20:54 If killed, discard servers with: spread -reuse-pid=331118 -discard
2024-12-18 14:20:54 Allocating adhoc-lxd:ubuntu-core-24-64...
2024-12-18 14:21:13 Waiting for adhoc-lxd:ubuntu-core-24-64 to make SSH available at 10.27.212.39:22...
2024-12-18 14:21:13 Allocated adhoc-lxd:ubuntu-core-24-64.
2024-12-18 14:21:13 Connecting to adhoc-lxd:ubuntu-core-24-64...
2024-12-18 14:21:13 Connected to adhoc-lxd:ubuntu-core-24-64 at 10.27.212.39:22.
2024-12-18 14:21:13 Sending project content to adhoc-lxd:ubuntu-core-24-64...
2024-12-18 14:21:16 Preparing adhoc-lxd:ubuntu-core-24-64 (adhoc-lxd:ubuntu-core-24-64)...
2024-12-18 14:24:55 Preparing adhoc-lxd:ubuntu-core-24-64:tests/main/ (adhoc-lxd:ubuntu-core-24-64)...
2024-12-18 14:26:36 Rebooting on adhoc-lxd:ubuntu-core-24-64 (adhoc-lxd:ubuntu-core-24-64:tests/main/) as requested...
2024-12-18 14:28:15 Preparing adhoc-lxd:ubuntu-core-24-64:tests/main/snap-info (adhoc-lxd:ubuntu-core-24-64)...
2024-12-18 14:28:27 Executing adhoc-lxd:ubuntu-core-24-64:tests/main/snap-info (adhoc-lxd:ubuntu-core-24-64) (1/1)...
2024-12-18 14:28:30 Restoring adhoc-lxd:ubuntu-core-24-64:tests/main/snap-info (adhoc-lxd:ubuntu-core-24-64)...
2024-12-18 14:28:45 Restoring adhoc-lxd:ubuntu-core-24-64:tests/main/ (adhoc-lxd:ubuntu-core-24-64)...
2024-12-18 14:28:45 Restoring adhoc-lxd:ubuntu-core-24-64 (adhoc-lxd:ubuntu-core-24-64)...
2024-12-18 14:28:46 Discarding adhoc-lxd:ubuntu-core-24-64...
2024-12-18 14:28:47 Successful tasks: 1
2024-12-18 14:28:47 Aborted tasks: 0

Thanks for helping us make a better snapd!
Have you signed the license agreement and read the contribution guide?

@bboozzoo bboozzoo added the Skip spread Indicate that spread job should not run label Dec 18, 2024
@bboozzoo bboozzoo closed this Dec 18, 2024
@bboozzoo bboozzoo reopened this Dec 18, 2024
Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

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

This looks great, I'm so excited for this to land!

PasswordAuthentication yes
EOF
fi
- killall -HUP sshd || true
Copy link
Member

Choose a reason for hiding this comment

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

Can systemctl reload sshd.service not be used here?

ubuntu:
# those are pulled out of spread
- cloud-init status --wait
- sed -i "s/^\s*#\?\s*\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/" /etc/ssh/sshd_config
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit too magic for my eyes, a comment explaining what this does would help :)

Add an adhoc backend which uses LXD to allocate VMs on demand.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@bboozzoo bboozzoo force-pushed the bboozzoo/lxd-vm-backend-adhoc branch from d1c6b15 to 15cd9bf Compare December 20, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛔ Blocked Skip spread Indicate that spread job should not run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants