-
Notifications
You must be signed in to change notification settings - Fork 119
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
KV provider #1230
base: main
Are you sure you want to change the base?
KV provider #1230
Conversation
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 |
c69b93f
to
1ff08d2
Compare
1ff08d2
to
b54838d
Compare
b54838d
to
28752d9
Compare
/test all |
28752d9
to
86c176f
Compare
I think a reason for this flake, the one where the CI job keeps waiting on the node to stop is that the node shuts down before reporting the status back to the ssh agent which makes it not know whether this happened or no this code previously looked like this _cmd(cli, nodeContainer(prefix, nodeName), "ssh.sh sudo shutdown now -h", "shutting down the node") and now it looks like this (this PR introduces this change) if err = sshClient.Command("sudo shutdown now -h"); err != nil {
return err
} which results in a golang error, since previously the error wasn't being handled
and so what i suggest we do is that we don't handle the error, i don't know if we also need to force the code to continue executing after a certain duration but this may not be necessary. since previously when ssh.sh would fail the gocli wouldn't get this failure and the CI run hangs. but since we now ssh directly its guaranteed that if there's an error you will get it I will push a commit with this suggestion |
@@ -0,0 +1,6 @@ | |||
[isv_kubernetes_addons_cri-o_stable_v1.28] | |||
name=CRI-O v1.28 (Stable) (rpm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need some version handling here - cri-o version should match the k8s version being deployed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah agreed, after inspecting the existing state of the code. some providers share crio version but occasionally one provider might deviate. will account for this
Is this from the
|
yes, i believe so. since when it was executed through |
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 <aerosound161@gmail.com>
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 <aerosound161@gmail.com>
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 <aerosound161@gmail.com>
This functionality now exists in the KubevirtProvider type and doesn't need a package of its own Signed-off-by: aerosouund <aerosound161@gmail.com>
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 <aerosound161@gmail.com>
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 <aerosound161@gmail.com>
Signed-off-by: aerosouund <aerosound161@gmail.com>
Signed-off-by: aerosouund <aerosound161@gmail.com>
ea8daed
to
234e2b1
Compare
/hold |
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. |
@aerosouund: The following tests failed, say
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. I understand the commands that are listed here. |
What this PR does / why we need it:
Create the KubevirtProvider type and make it the main entity for cluster actions
Part of: #1110
Special Notes
This branch is based off
opts
. PR: #1217it introduces the same commits but after opts gets merged it will only introduce commits of the kubevirt provider
Checklist
Release note: