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

Add platform for external provisioning #212

Merged
merged 1 commit into from
Aug 27, 2021
Merged

Conversation

pothos
Copy link
Member

@pothos pothos commented Aug 19, 2021

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.

@pothos pothos force-pushed the kai/custom-platform branch 2 times, most recently from 950a645 to 6d57a98 Compare August 25, 2021 16:04
@pothos pothos marked this pull request as ready for review August 26, 2021 08:16
@pothos pothos requested a review from a team August 26, 2021 08:16
cmd/kola/options.go Outdated Show resolved Hide resolved
platform/machine/external/cluster.go Outdated Show resolved Hide resolved
platform/machine/external/cluster.go Outdated Show resolved Hide resolved
platform/machine/external/cluster.go Show resolved Hide resolved
platform/machine/external/cluster.go Show resolved Hide resolved
platform/machine/external/console.go Show resolved Hide resolved
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.
@pothos pothos force-pushed the kai/custom-platform branch from 6d57a98 to a6e85e9 Compare August 26, 2021 12:17
@pothos pothos merged commit 92c9d6f into flatcar-master Aug 27, 2021
@pothos pothos deleted the kai/custom-platform branch August 27, 2021 09:04
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.

2 participants