Repository navigation
Add libvirt backend - #6985
Add libvirt backend#6985hasufell wants to merge 27 commits into
Conversation
|
There's several caveats: How to connect to the machineThere's at least 3 methods:
I picked option 3... which means the user has to set up working ssh inside the VM. There's two ways to do the ssh connection: by inspecting a network interface inside the VM and getting the IP... or by using the libvirt NSS method, which sets up domain names equivalent to the VM name (more elegant) The user also has to configure the following in Shared diskIf we want to execute multiple steps and retain the working directory/checkout, we need to have a disk that is shared across VMs. Unfortunately, mounting a host folder doesn't work consistently across platforms and hypervisors, so the best method is to require the user to provide a disk and a configuration. However, the guest operating system needs to know how to mount the disk, so we also need to assign e.g. a serial number. Windows prerequisites for mountingTo be able to mount the shared disk on windows, we need the following. Disable UAC remote token filtering: New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" `
-Name "LocalAccountTokenFilterPolicy" -Value 1 -PropertyType DWord -ForceSet your network to private: Set-NetConnectionProfile -InterfaceIndex <index> -NetworkCategory PrivateStart WinRM service: winrm quickconfigEphemeral VMsThis supports fully ephemeral VMs: the disks of the "base VMs" are copied. For qemu disks, it is zero-cost copy thanks to qcow2. For raw disks we need to copy the whole file. |
|
Example workflow: |
|
Thanks! Just a question towards this new backend: As there were quite some people asking for this, I think it's a good idea to get that into the core repo. However, I do not think any of us maintainers will use it, so we depend on contributions from libvirt users like you. This also means if other people open PRs for this backend we will ping you and ask to review - is that fine for you? |
Yes. |
fe597b4 to
b1788a6
Compare
27355e2 to
2606e83
Compare
|
your pull got conflicts - just merge main in :) and https://ci.woodpecker-ci.org/repos/3780/pipeline/37299 ... still i know it is WIP ... just some notes i saw |
|
I think this is now ready for review... documentation is still missing, but the implementation now works. I'm not sure how to assist reviewers here... it requires a lot of knowledge of:
If any decision/pattern feels odd, then please raise it, so I can explain and add an inline comment. It's also possible I forgot some of the decisions along the way when experimenting with different approaches. Most things that look weird are most likely there for portability reasons (e.g. I tried to keep the changes to the other backends to a minimum, but the script generation did change. |
|
Also, I rebased, so it's possible I messed something up. |
23a9169 to
ea4208e
Compare
|
Thanks, is there a reason to downgrade so many dependencies? |
Not at all. That's probably just me struggling with go tooling. It's been 8 years since I did go. |
|
Surge PR preview deployment succeeded. View it at https://woodpecker-ci-woodpecker-pr-6985.surge.sh |
| github.com/google/go-github/v93 v93.0.0 | ||
| github.com/hashicorp/go-hclog v1.6.3 | ||
| github.com/hashicorp/go-plugin v1.8.0 | ||
| github.com/jakobii/syncx v0.3.0 |
There was a problem hiding this comment.
well this repo is archived and migrated ...
| codeberg.org/6543/go-yaml2json/v2 v2.0.0 | ||
| codeberg.org/6543/xyaml/v2 v2.0.1 | ||
| codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v4 v4.0.0 | ||
| darvaza.org/x/sync v0.6.1 |
There was a problem hiding this comment.
a second sync lib ... can we stay at one
|
the "relevant libvirt tickets" are now all closed 🎉 ... ... I did not dig deep into the impl. jet just the buildsystem etc... |
|
@hasufell i have addressed the build issue ... can you look into the sync dependency issues... |

Fixes #2302
Depends on:
Relevant libvirt tickets (mostly affecting bhyve backend):
Notes on AI use:
TODO: