Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ tests:
IP_STACK=v4v6
NETWORK_TYPE=OVNKubernetes
workflow: baremetalds-e2e
- as: e2e-metal-ipi-ocp-sdn-ipv4-upgrade
steps:
cluster_profile: packet
env:
DEVSCRIPTS_CONFIG: |
IP_STACK=v4
NETWORK_TYPE=OpenShiftSDN
RUN_UPGRADE_TEST: "true"
workflow: baremetalds-e2e-upgrade
zz_generated_metadata:
branch: master
org: openshift-metal3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,72 @@ presubmits:
secretName: result-aggregator
trigger: (?m)^/test( | .* )e2e-metal-ipi,?($|\s.*)
- agent: kubernetes
always_run: false
always_run: true
branches:
- master
cluster: build02
context: ci/prow/e2e-metal-ipi-ocp-sdn-ipv4-upgrade
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/prowgen-controlled: "true"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-metal3-dev-scripts-master-e2e-metal-ipi-ocp-sdn-ipv4-upgrade
rerun_command: /test e2e-metal-ipi-ocp-sdn-ipv4-upgrade
spec:
containers:
- args:
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --lease-server-password-file=/etc/boskos/password
- --report-password-file=/etc/report/password.txt
- --report-username=ci
- --secret-dir=/usr/local/e2e-metal-ipi-ocp-sdn-ipv4-upgrade-cluster-profile
- --target=e2e-metal-ipi-ocp-sdn-ipv4-upgrade
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /etc/boskos
name: boskos
readOnly: true
- mountPath: /usr/local/e2e-metal-ipi-ocp-sdn-ipv4-upgrade-cluster-profile
name: cluster-profile
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: boskos
secret:
items:
- key: password
path: password
secretName: boskos-credentials
- name: cluster-profile
projected:
sources:
- secret:
name: cluster-secrets-packet
- configMap:
name: cluster-profile-packet
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )e2e-metal-ipi-ocp-sdn-ipv4-upgrade,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
- master
cluster: build02
Expand All @@ -78,7 +143,6 @@ presubmits:
ci-operator.openshift.io/prowgen-controlled: "true"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-metal3-dev-scripts-master-e2e-metal-ipi-ovn-dualstack
optional: true
rerun_command: /test e2e-metal-ipi-ovn-dualstack
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cp /root/pull-secret /root/dev-scripts/pull_secret.json

curl https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.4/linux/oc.tar.gz | tar -C /usr/bin -xzf -

echo "export OPENSHIFT_RELEASE_IMAGE=${RELEASE_IMAGE_LATEST}" >> /root/dev-scripts/config_root.sh
echo "export OPENSHIFT_RELEASE_IMAGE=${OPENSHIFT_INSTALL_RELEASE_IMAGE}" >> /root/dev-scripts/config_root.sh
echo "export ADDN_DNS=\$(awk '/nameserver/ { print \$2;exit; }' /etc/resolv.conf)" >> /root/dev-scripts/config_root.sh
echo "export OPENSHIFT_CI=true" >> /root/dev-scripts/config_root.sh
echo "export WORKER_MEMORY=16384" >> /root/dev-scripts/config_root.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ ref:
- name: DEVSCRIPTS_CONFIG
default: ""
documentation: Additional dev-scripts configuration, appended to the one defined by the step command. See https://github.com/openshift-metal3/dev-scripts/blob/master/README.md for more details about supported values.
dependencies:
- name: "release:latest"
env: OPENSHIFT_INSTALL_RELEASE_IMAGE
documentation: |-
Checkout and execute dev-scripts on a packet server
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -o nounset
set -o errexit
set -o pipefail
set -x

echo "************ baremetalds test command ************"

Expand All @@ -28,25 +29,64 @@ IP=$(cat "${SHARED_DIR}/server-ip")

SSHOPTS=(-o 'ConnectTimeout=5' -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null' -o 'ServerAliveInterval=90' -i "${CLUSTER_PROFILE_DIR}/.packet-kni-ssh-privatekey")

collect_artifacts() {
echo "### Fetching results"
ssh "${SSHOPTS[@]}" "root@${IP}" tar -czf - /tmp/artifacts | tar -C "${ARTIFACT_DIR}" -xzf -
}
trap collect_artifacts EXIT

# Copy test binaries on packet server
echo "### Copying test binaries"
scp "${SSHOPTS[@]}" /usr/bin/openshift-tests /usr/bin/kubectl "root@${IP}:/usr/local/bin"

# Tests execution
set +e
if [[ -s "${SHARED_DIR}/test-list" ]]; then
echo "### Copying test-list file"
scp "${SSHOPTS[@]}" "${SHARED_DIR}/test-list" "root@${IP}:/tmp/test-list"
echo "### Running tests"
ssh "${SSHOPTS[@]}" "root@${IP}" openshift-tests run "openshift/conformance/parallel" --dry-run \| grep -Ff /tmp/test-list \|openshift-tests run -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit -f -

# Test upgrade for workflows that requested it
if [[ "$RUN_UPGRADE_TEST" == true ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check it's ok, anyhow I'd suggest to follow an approach similar to the one in #12959 (to be as much as possible similar to the ones adopted by the other profiles) where possible, ie making a check directly against OPENSHIFT_UPGRADE_RELEASE_IMAGE as in https://github.com/openshift/release/blob/d4f03b5848e88d409f6b0cac7ec205f47530e07b/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh#L75 (we'll save one var)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this approach, the problem is that OPENSHIFT_UPGRADE_RELEASE_IMAGE will always be non-empty since the step specifies it as a dependency, so I've needed a new variable.

From where the TEST_COMMAND variable comes from? I didn't see it in any of the templates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that's a sanity check (always expected to be not empty). They've defined TEST_COMMAND as a normal env var in the openshift-e2e-test.
In our case we've the additional requirement to filter our some of the conformance tests (in the case of installation test), checking the current value of TEST_COMMAND could help in crafting properly the various pieces required by openshift-tests (the command itself, additional options such as --to-image and the filter list)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, https://github.com/openshift/release/pull/13120/files#diff-7b4946fc316154f2f0fe2beac2371cf82bc14d8071298890e8a014417e88159f doesn't use the TEST_COMMAND variable. If we want to use it, I would request to do it in a different PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to adopt it if possible in the current PR, so that also the code duplication will be removed. If not, it's ok to address it in another PR.

echo "### Running Upgrade tests"
timeout \
--kill-after 10m \
120m \
ssh \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not required anymore, could this timeout be removed (there will be also the CI default one for the job)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to keep it just in case other issues will cause the code to get stuck. In this case, it would be good to have the logs.

"${SSHOPTS[@]}" \
"root@${IP}" \
openshift-tests \
run-upgrade \
--to-image "$OPENSHIFT_UPGRADE_RELEASE_IMAGE" \
-o /tmp/artifacts/e2e-upgrade.log \
--junit-dir /tmp/artifacts/junit-upgrade \
platform
else
echo "### Running tests"
ssh "${SSHOPTS[@]}" "root@${IP}" openshift-tests run "openshift/conformance/parallel" --dry-run \| grep 'Feature:ProjectAPI' \| openshift-tests run -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit -f -
if [[ -s "${SHARED_DIR}/test-list" ]]; then
echo "### Copying test-list file"
scp \
"${SSHOPTS[@]}" \
"${SHARED_DIR}/test-list" \
"root@${IP}:/tmp/test-list"
echo "### Running tests"
ssh \
"${SSHOPTS[@]}" \
"root@${IP}" \
openshift-tests \
run \
"openshift/conformance/parallel" \
--dry-run \
\| grep -Ff /tmp/test-list \|openshift-tests run -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit -f -
else
echo "### Running tests"
ssh \
"${SSHOPTS[@]}" \
"root@${IP}" \
openshift-tests \
run \
"openshift/conformance/parallel" \
--dry-run \
\| grep 'Feature:ProjectAPI' \| openshift-tests run -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit -f -
fi
fi
rv=$?

echo "### Fetching results"
ssh "${SSHOPTS[@]}" "root@${IP}" tar -czf - /tmp/artifacts | tar -C "${ARTIFACT_DIR}" -xzf -
rv=$?

set -e
echo "### Done! (${rv})"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ ref:
memory: 600Mi
limits:
memory: 2Gi
env:
- name: RUN_UPGRADE_TEST
default: "false"
documentation: If the value is equal to "true", run only the upgrade tests
dependencies:
- name: "release:latest"
env: OPENSHIFT_UPGRADE_RELEASE_IMAGE
documentation: |-
The Baremtal DS E2E step executes the common end-to-end test suite.
7 changes: 7 additions & 0 deletions ci-operator/step-registry/baremetalds/e2e/upgrade/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
approvers:
- eisraeli
- andfasano
- akiselev1
- derekhiggins
- honza
- stbenjam
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"path": "baremetalds/e2e/upgrade/baremetalds-e2e-upgrade-workflow.yaml",
"owners": {
"approvers": [
"eisraeli",
"andfasano",
"akiselev1",
"derekhiggins",
"honza",
"stbenjam"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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
post:
- ref: baremetalds-devscripts-gather
- ref: baremetalds-packet-teardown
env:
RUN_UPGRADE_TEST: "true"
dependencies:
OPENSHIFT_INSTALL_RELEASE_IMAGE: release:initial
documentation: |-
This workflow executes the common end-to-end upgrade test suite on a cluster provisioned by running dev-scripts on a packet server.