-
Notifications
You must be signed in to change notification settings - Fork 120
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
Bootc provisioner #1247
Bootc provisioner #1247
Conversation
Signed-off-by: aerosouund <[email protected]>
The K8s client is a type to perform kubernetes operations on arbitrary manifests and embedded in it is the schema for all needed resources. It includes also a test client implementation for unit tests. Signed-off-by: aerosouund <[email protected]>
…e SSH Client interface The new method is used to copy an arbitrary file on a node or a remote entity to a local path. The modification to the SSH method is to allow the returning of stdOut as a string to the caller or to supress output Signed-off-by: aerosouund <[email protected]>
This package is a go representation for each bash script that was run to configure an option for the KubeVirtCI cluster, where each script maps to a particular SomethingOpt type. They all share an interface of having an Exec() error method Signed-off-by: aerosouund <[email protected]>
…ckage Some options for the kubevirt cluster were solely dependent on the bash code, this adds them to the go code As well as refactor the constructors for configs to the the options pattern to avoid having a constructor that takes too many args Signed-off-by: aerosouund <[email protected]>
… gocli flags Remove the need to run any scripts in the run command and depend on the opts package. Refactor provisionNode and provisionK8sOptions to use the options pattern instead of passing many args to the constructor. Add new flags to the gocli which were previously only in the bash code. Remove prepareDeviceForAssignment and prepareDeviceForAssignment as they both have been moved to opts. Signed-off-by: aerosouund <[email protected]>
Signed-off-by: aerosouund <[email protected]>
… opts Move params to gocli params intialization instead Signed-off-by: aerosouund <[email protected]>
…pts and new constructors Signed-off-by: aerosouund <[email protected]>
Two new opts that represent the two scripts used in the provision phase (provision linux and provision k8s). Using go embed to include any necessary config files then run the commands on a node using libssh Signed-off-by: aerosouund <[email protected]>
The KubevirtProvider is a struct representing an arbitrary Kubevirtci running cluster. It holds all config flags and options that are in the run and provision commands. A Kubevirt provider can be created in two ways, by creating a cluster using the Start method, or from an already running cluster. For this to be possible then json representation of the struct is persisted on the dnsmasq container and later read to parse the deployed settings Or through the normal constructor which uses the option pattern to avoid a bloated function signature The logic that was previously in run.go has been split to several methods to facilitate readability and testing (runNFSGanesha, runRegistry, prepareQemuCmd, prepareDeviceMappings) and dnsmasq creation logic got moved to its own method instead of existing in its own package Floating methods such as waitForVMToBeUp, nodeNameFromIndex, nodeContainer.. etc were grouped to be methods of the struct Signed-off-by: aerosouund <[email protected]>
To avoid having to read each flag and return an error if its unset leverage the FlagMap, a map of flag name to FlagConfig. a FlagConfig is the type of this flag (string, int, uint16, bool or array of string) and the option function that sets the value of this flag on the KubevirtProvider struct. During parsing of flags this map is being iterated on and each option gets appended to an array to later be used in the KubevirtProvider constructor. The run method's role is now to parse the flags and pass them to the provider and just call Start. All the floating methods in run.go are removed after being moved to the provider. Signed-off-by: aerosouund <[email protected]>
This functionality now exists in the KubevirtProvider type and doesn't need a package of its own Signed-off-by: aerosouund <[email protected]>
The KubevirtProvider type is what provides the methods that run a node or run the k8s options. Testing logic has been moved to a Base Provider Suite Signed-off-by: aerosouund <[email protected]>
Implement provisioning logic on the provider and leverage the linux and k8s provisioning instead of the scripts. Leverage the same pattern of creating an unpriviliged sshClient to add the ssh key to the root user then use a priviliged client. Include a map of version major, minor to a version with major, minor and patch to pass it to the provisionk8s opt. Remove unwanted floating methods such as _cmd, performPhase and implement copyDirectory as a method of the provider type. Change provision.go command to call the Provision method. Change type of port flags to uint16 to match the struct type. Change default value of random-ports to true. THIS COMMIT BREAKS THE KUBEVIRTCI RELEASE AND VERSIONING PATTERNS Signed-off-by: aerosouund <[email protected]>
Signed-off-by: aerosouund <[email protected]>
Signed-off-by: aerosouund <[email protected]>
Signed-off-by: aerosouund <[email protected]>
The cri package provides interfaces to run, build, and other relevant container actions agnostic of a specific runtime. Supports docker and podman. Signed-off-by: aerosouund <[email protected]>
The bootc package provides a type that can be used to generate qcow2 disk images from container images Ir provides a containerfile that maps to the linux phase and another for the k8s phase, In addition to a systemd unit that makes changes to the operating system to match the needs of kubevirtCI, Which are setting ipv4 and ipv6 assignment to auto by network manager, as well as moving /opt to a writable directory Signed-off-by: aerosouund <[email protected]>
… the service command doesn't exist Signed-off-by: aerosouund <[email protected]>
Package installation will take place in the containers built by the bootc provisioner Signed-off-by: aerosouund <[email protected]>
… the bootc provisioner The provisioning logic is changed to be: 1. Build the linux phase container and if only linux phase is required build a qcow2 from it and include it in a final container 2. if the k8s phase is also required, the k8s phase container is built and the qcow2 is generated from it. then spin up a cluster and run the k8s opt A new version of vm.sh is introduced that uses the disk that was copied to the container during build rather than the previously existing one Signed-off-by: aerosouund <[email protected]>
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Hi @aerosouund. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@aerosouund That's an impressive work! Thank you. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. /close |
@kubevirt-bot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it:
Use bootc in provisioning k8s providers rather than relying on golang opts running bash
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Special notes for your reviewer:
This PR is based off #1230
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note: