Add platform for external provisioning #212
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing platforms have their provisioning logic in Go, using
cloud-vendor API libraries or a hardcoded QEMU setup. Following this
approach it's difficult to add a custom platform for, e.g., a PXE and
IPMI environment.
Introduce a new generic platform which is based on external
provisioning commands. The kola user can thus provide shell commands
for provisioning, console attachment, and deprovisioning, be it using
ipmitool and a custom PXE setup or invoking Terraform or any other
tools to create a virtual machine. For now the commands are run via SSH
because this is the current use case but local execution can be added
when needed. It's also possible to let the SSH session be created
through a SOCKS5 proxy for, e.g., having the management SSH host on a
Hidden Tor Service. SSH login is done with a password, but here, too,
using keys can be added when needed.
An example invocation is:
./kola run -d -k --board=arm64-usr --platform=external --external-user=core "--external-password=$(cat external-password)" "--external-provisioning-cmds=$(echo BASE_URL=http://alpha.release.flatcar-linux.net/arm64-usr/current; cat external-provisioning-cmds)" "--external-serial-console-cmd=$(cat external-serial-console-cmd)" "--external-deprovisioning-cmds=$(cat external-deprovisioning-cmds)" --external-socks=127.0.0.1:9050 --external-host=myonionserver.onion:22 cl.basic
And the content of the "external-*" scripts can be found in the
flatcar-scripts/jenkins/kola/ folder. (See flatcar/scripts#144)
How to use
Testing done
I used it to run arm64 tests which didn't succeed because of the polkit error.