-
Notifications
You must be signed in to change notification settings - Fork 2.3k
WIP: Add baremetalds-e2e-upgrade-workflow #11436
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
Changes from 3 commits
7585a99
e650f68
cefbbdd
dc6dd1f
cae97f9
015fa4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| approvers: | ||
| - andfasano | ||
| - eisraeli | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| workflow: | ||
| as: baremetalds-e2e-upgrade | ||
| steps: | ||
| allow_skip_on_success: true | ||
| pre: | ||
| - ref: baremetalds-packet-setup | ||
| - ref: ipi-install-rbac | ||
| - ref: baremetalds-devscripts-setup | ||
| test: | ||
| - ref: baremetalds-e2e-conf | ||
| - ref: baremetalds-e2e-test | ||
| - ref: baremetalds-e2e-upgrade-upgrade | ||
|
eisraeli marked this conversation as resolved.
|
||
| - ref: openshift-e2e-test | ||
| # - ref: baremetalds-e2e-upgrade-test | ||
| post: | ||
| - ref: baremetalds-devscripts-gather | ||
| # - ref: baremetalds-packet-teardown | ||
| env: | ||
| TEST_SUITE: "all" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would override |
||
| documentation: |- | ||
| This workflow executes the common end-to-end test suite on a cluster provisioned by running dev-scripts on a packet server. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| approvers: | ||
| - andfasano | ||
| - eisraeli |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o nounset | ||
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| echo "************ baremetalds e2e upgrade test command ************" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step is no needed, |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ref: | ||
| as: baremetalds-e2e-upgrade-test | ||
| from: tests | ||
| commands: baremetalds-e2e-upgrade-test-commands.sh | ||
| resources: | ||
| requests: | ||
| cpu: "3" | ||
| memory: 600Mi | ||
| limits: | ||
| memory: 2Gi | ||
| documentation: |- | ||
| This is a step to test the upgrade |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| approvers: | ||
| - andfasano | ||
| - eisraeli | ||
|
eisraeli marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||
| #!/bin/bash | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is not required -
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not possible to use the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that the current implementation support release/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh Line 51 in 1d793ed
dev-scripts in the remote packet instance (Line 99 in 1d793ed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'd have to add support for it then. I don't think it has any specific flags, you'd need to reuse existing legacy templates.
Copy it to
This is necessary for this PR to land and be approved by OTA team
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not seeing any tricks to access it in this commit. If
Team taking care of upgrades, including CI upgrade tests.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What do you mean? It's not about Packet. It's because we save significant amounts of money by running baremetal clusters through emulated baremetal with libvirt + vbmc/sushy-tools. The cluster is contained within the libvirt networks on the host, therefore the API is not exposed on the public IP. Maybe we could do it with some iptables/xinetd trickery, but we haven't looked into that yet. The entire purpose of baremetalds-e2e-upgrade-test-commands is that it runs the e2e-tests suites by SSH'ing to the host. I agree about mulisteps tests should be useful for everyone, and in fact the baremetalds workflows existed long before any other platforms did, and when it came time to create the ipi, upgrade, etc steps our specific use cases weren't considered so most of our steps remained special.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This workflow would create pods on api.ci / build01 / build02 CI cluster. How would they reach the created cluster? This should should not hardcode the release, it should not use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, okay, that was my concern - upgrade should happen via |
||||||
|
|
||||||
| set -o nounset | ||||||
| set -o errexit | ||||||
| set -o pipefail | ||||||
|
|
||||||
| registry="registry.svc.ci.openshift.org" | ||||||
| namespace="ocp" | ||||||
| repository="release" | ||||||
| #Hard-coded for now | ||||||
| upgrade_version_label="4.6.0-0.ci-2020-09-10-092129" | ||||||
| #upgrade_by_digest="bc601ebdd308f26178c8f03b570e76b0a79c8db01969b082de0fa967ee3ef998" | ||||||
|
|
||||||
| check_before_upgrade () { | ||||||
| # Check that all nodes are in a Ready status. | ||||||
| nodes_health=$(oc get nodes | awk '{print $2}' | awk '!/STATUS/ && !/Ready/') | ||||||
| if [ ! -z ${nodes_health} ]; then echo "ERROR: One of the nodes is not in a ready state" && exit 1; fi; | ||||||
|
|
||||||
| # Verify the current status version is available and there is no upgrade in progress. | ||||||
| upgrade_in_progress=$(oc get clusterversion | awk '{print $4}' | awk '!/PROGRESSING/ && !/False/') | ||||||
| if [ ! -z ${upgrade_in_progress} ]; then echo "ERROR: Upgrade in progress" && exit 1; fi; | ||||||
|
|
||||||
| # Ensure the cluster is healthy and the upgrade can be performed checking that all operators are available, | ||||||
| # none of them should be degraded. | ||||||
| all_operators_available=$(oc get clusteroperators | awk '{print $3}' | awk '!/AVAILABLE/ && !/True/') | ||||||
| if [ ! -z ${all_operators_available} ]; then echo "ERROR: One of the operators is unavailable" && exit 1; fi; | ||||||
|
|
||||||
| no_updates_in_progress=$(oc get clusteroperators | awk '{print $4}' | awk '!/PROGRESSING/ && !/False/') | ||||||
| if [ ! -z ${no_updates_in_progress} ]; then echo "ERROR: A cluster version change is in progress" && exit 1; fi; | ||||||
|
|
||||||
| no_degraded_operators=$(oc get clusteroperators | awk '{print $5}' | awk '!/DEGRADED/ && !/False/') | ||||||
| if [ ! -z ${no_degraded_operators} ]; then echo "ERROR: One or more degraded operators." && exit 1; fi; | ||||||
| } | ||||||
|
|
||||||
| check_before_upgrade | ||||||
|
|
||||||
| echo "************ baremetalds e2e upgrade command ************" | ||||||
| #echo ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE} | ||||||
|
|
||||||
| current_version=$(oc get clusterversion | awk '{print $2}' | awk '!/VERSION/') | ||||||
| original_version=$current_version | ||||||
| echo "Current cluster version: $current_version" | ||||||
|
|
||||||
| echo "Updating to version: $upgrade_version_label" | ||||||
| oc adm upgrade --force --allow-explicit-upgrade --to-image=${registry}/${namespace}/${repository}:${upgrade_version_label} | ||||||
| #oc adm upgrade --force --allow-explicit-upgrade --to-image=${registry}${repository}@sha256:${upgrade_by_digest} | ||||||
|
|
||||||
| while [ $current_version != $upgrade_version_label ]; do sleep 5; current_version=$(oc get clusterversion | awk '{print $2}' | awk '!/VERSION/'); done | ||||||
|
|
||||||
| echo "Finished upgrading from version $original_version to version $upgrade_version_label !" | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ref: | ||
| as: baremetalds-e2e-upgrade-upgrade | ||
| from: tests | ||
| commands: baremetalds-e2e-upgrade-upgrade-commands.sh | ||
| resources: | ||
| requests: | ||
| cpu: "3" | ||
| memory: 600Mi | ||
| limits: | ||
| memory: 2Gi | ||
| documentation: |- | ||
| This is a step to perform an upgrade |
Uh oh!
There was an error while loading. Please reload this page.