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

[LPTOCPCI-6] MTR Operator Scenario #36181

Merged
merged 22 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
053c6c5
Initial commit for the creation of the MTR Interop Scenario
calebevans Feb 8, 2023
cc3026c
Adding scenario and step documentation
calebevans Feb 9, 2023
6a7d580
Adding suggestions from PR review
calebevans Feb 9, 2023
0b0c5fd
Update Prow job name to be consistent with documentation.
calebevans Feb 14, 2023
99365a2
Adding windup prow configs
calebevans Feb 17, 2023
90b04af
Remove tide and lgtm
calebevans Feb 17, 2023
0e49b0a
Remove prow config
calebevans Feb 17, 2023
67c503c
Merge branch 'openshift:master' into lp-interop-mtr
calebevans Feb 20, 2023
5af22c3
Use new install-operators ref and update documentation.
calebevans Feb 20, 2023
7552d49
Remove 'initial' release from the windup config.
calebevans Feb 21, 2023
f781fe4
Adding PQE users as owners for MTR-specific steps.
calebevans Feb 22, 2023
4bb5454
Removing "Maintainers" line from the README.
calebevans Feb 23, 2023
9e0914a
Remove Ryan from OWNERS files, per his request.
calebevans Mar 2, 2023
ed75975
Change the OWNERS files to use the cspi-qe-ocp-lp group rather than i…
calebevans Mar 9, 2023
dfbf706
Add my fork temporarily to test a new image
calebevans Mar 9, 2023
98ca74a
Remove spot instances
calebevans Mar 10, 2023
acac931
Remove Cypress install and clean up debugging jobs
calebevans Mar 14, 2023
9027789
Adding suggestions from PR review
calebevans Mar 15, 2023
151e1ac
Adding step to copy any screenshots into the artifact directory
calebevans Mar 16, 2023
1650d64
Add || true to test execution
calebevans Mar 16, 2023
5076802
Fix the TARGET_URL logic
calebevans Mar 16, 2023
d6660a0
Adding recommendations from PR review
calebevans Mar 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions ci-operator/config/windup/windup-ui-tests/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
approvers:
calebevans marked this conversation as resolved.
Show resolved Hide resolved
- cspi-qe-ocp-lp
- sshveta
- stillalearner
options: {}
reviewers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
63 changes: 63 additions & 0 deletions ci-operator/config/windup/windup-ui-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# windup-windup-ui-tests-main<!-- omit from toc -->

## Table of Contents<!-- omit from toc -->
- [General Information](#general-information)
- [Purpose](#purpose)
- [Process](#process)
- [Cluster Provisioning and Deprovisioning: `ipi-aws`](#cluster-provisioning-and-deprovisioning-ipi-aws)
- [Test Setup, Execution, and Reporting Results - `mtr-interop-aws`](#test-setup-execution-and-reporting-results---mtr-interop-aws)
- [Prerequisite(s)](#prerequisites)
- [Environment Variables](#environment-variables)
- [Custom Images](#custom-images)

## General Information

- **Repository**: [windup/windup-ui-tests](https://github.com/windup/windup-ui-tests)
- **Operator Tested**: [MTR (Migration Toolkit for Runtimes)](https://developers.redhat.com/products/mtr/overview)

## Purpose

To provision the necessary infrastructure and using that infrastructure to execute MTR interop tests. The results of these tests will be reported to the appropriate sources following execution.

## Process

The MTR Interop scenario can be broken into the following basic steps:

1. Provision a test cluster on AWS
2. Install the MTR operator and deploy Windup
3. Execute tests and archive results
4. Deprovision a test cluster.

### Cluster Provisioning and Deprovisioning: `ipi-aws`

Please see the [`ipi-aws`](https://steps.ci.openshift.org/workflow/ipi-aws) documentation for more information on this workflow. This workflow is not maintained by the Interop QE team.

### Test Setup, Execution, and Reporting Results - `mtr-interop-aws`

Following the test cluster being provisioned, the following steps are executed in this order:

1. [`install-operators`](../../../step-registry/install-operators/README.md)
2. [`mtr-deploy-windup-ref`](../../../step-registry/mtr/deploy-windup/README.md)
3. [`mtr-tests-ui-ref`](../../../step-registry/mtr/tests/ui/README.md)

## Prerequisite(s)

### Environment Variables

- `BASE_DOMAIN`
- **Definition**: A fully-qualified domain or subdomain name. The base domain of the cloud provider is used for setting baseDomain variable of the install configuration of the cluster.
- **If left empty**: The [`ipi-aws` workflow](../../../step-registry/ipi/aws/ipi-aws-workflow.yaml) will fail.
- `OPERATORS`
- **Definition**: A JSON list of operators to install. Please see the [Defining `OPERATORS`](../../../step-registry/install-operators/README.md#defining-operators) section of the `install-operators` documentation for more information.
- **If left empty**: The [`install-operators`](../../../step-registry/install-operators/README.md) ref will fail.
- `MTR_TESTS_UI_SCOPE`
- **Definition**: Tag you'd like to use to execute Cypress. This value will determine which set of tests to run. For example, for interop testing the value should be `interop`.
- **If left empty**: It will use 'all' as the default value. Meaning all ui tests will execute.


### Custom Images

- `mtr-runner`
- [Dockerfile](https://github.com/windup/windup-ui-tests/blob/main/dockerfiles/interop/Dockerfile)
calebevans marked this conversation as resolved.
Show resolved Hide resolved
- The custom image for this step uses the [`cypress/base`](https://hub.docker.com/r/cypress/base) image as it's base. The image should have all of the required dependencies installed and the [windup/windup-ui-tests repository](https://github.com/windup/windup-ui-tests) copied into `/tmp/windup-ui-tests`.

calebevans marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
base_images:
cli:
name: "4.13"
namespace: ocp
tag: cli
os:
name: ubi
namespace: ocp
tag: "8"
build_root:
image_stream_tag:
name: release
namespace: openshift
tag: golang-1.19
images:
- context_dir: .
dockerfile_path: dockerfiles/interop/Dockerfile
to: mtr-runner
releases:
latest:
candidate:
product: ocp
stream: nightly
version: "4.13"
resources:
'*':
requests:
cpu: 100m
memory: 200Mi
tests:
- as: mtr-interop-aws
cron: 0 1 * * 1
steps:
cluster_profile: aws-cspi-qe
env:
BASE_DOMAIN: aws.interop.ccitredhat.com
MTR_TESTS_UI_SCOPE: interop
OPERATORS: |
calebevans marked this conversation as resolved.
Show resolved Hide resolved
[
{"name": "mtr-operator", "source": "redhat-operators", "channel": "alpha", "install_namespace": "mtr", "target_namespaces": "mtr"}
calebevans marked this conversation as resolved.
Show resolved Hide resolved
]
test:
- ref: install-operators
- ref: mtr-deploy-windup
- ref: mtr-tests-ui
workflow: ipi-aws
zz_generated_metadata:
branch: main
org: windup
repo: windup-ui-tests
variant: mtr-ocp4.13-lp-interop
9 changes: 9 additions & 0 deletions ci-operator/jobs/windup/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
approvers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
options: {}
reviewers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
9 changes: 9 additions & 0 deletions ci-operator/jobs/windup/windup-ui-tests/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
approvers:
calebevans marked this conversation as resolved.
Show resolved Hide resolved
- cspi-qe-ocp-lp
- sshveta
- stillalearner
options: {}
reviewers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
periodics:
- agent: kubernetes
cluster: build01
cron: 0 1 * * 1
decorate: true
decoration_config:
skip_cloning: true
extra_refs:
- base_ref: main
org: windup
repo: windup-ui-tests
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws-cspi-qe
ci-operator.openshift.io/variant: mtr-ocp4.13-lp-interop
ci.openshift.io/generator: prowgen
job-release: "4.13"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-windup-windup-ui-tests-main-mtr-ocp4.13-lp-interop-mtr-interop-aws
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --lease-server-credentials-file=/etc/boskos/credentials
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --secret-dir=/usr/local/mtr-interop-aws-cluster-profile
- --target=mtr-interop-aws
- --variant=mtr-ocp4.13-lp-interop
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /etc/boskos
name: boskos
readOnly: true
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /usr/local/mtr-interop-aws-cluster-profile
name: cluster-profile
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- 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: credentials
path: credentials
secretName: boskos-credentials
- name: ci-pull-credentials
secret:
secretName: ci-pull-credentials
- name: cluster-profile
secret:
secretName: cluster-secrets-aws-cspi-qe
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
presubmits:
calebevans marked this conversation as resolved.
Show resolved Hide resolved
windup/windup-ui-tests:
- agent: kubernetes
always_run: true
branches:
- ^main$
- ^main-
cluster: build01
context: ci/prow/mtr-ocp4.13-lp-interop-images
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/variant: mtr-ocp4.13-lp-interop
ci.openshift.io/generator: prowgen
job-release: "4.13"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-windup-windup-ui-tests-main-mtr-ocp4.13-lp-interop-images
rerun_command: /test mtr-ocp4.13-lp-interop-images
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --report-credentials-file=/etc/report/credentials
- --target=[images]
- --variant=mtr-ocp4.13-lp-interop
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )mtr-ocp4.13-lp-interop-images,?($|\s.*)
9 changes: 9 additions & 0 deletions ci-operator/step-registry/mtr/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
approvers:
calebevans marked this conversation as resolved.
Show resolved Hide resolved
- cspi-qe-ocp-lp
- sshveta
- stillalearner
options: {}
reviewers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
9 changes: 9 additions & 0 deletions ci-operator/step-registry/mtr/deploy-windup/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
approvers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
options: {}
reviewers:
- cspi-qe-ocp-lp
- sshveta
- stillalearner
34 changes: 34 additions & 0 deletions ci-operator/step-registry/mtr/deploy-windup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# mtr-deploy-windup-ref<!-- omit from toc -->

## Table of Contents<!-- omit from toc -->
- [Purpose](#purpose)
- [Process](#process)
- [Requirements](#requirements)
- [Infrastructure](#infrastructure)
- [Environment Variables](#environment-variables)

## Purpose

To deploy Windup in a specified namespace with a specified volume capacity. This step is necessary to execute the interop tests for the MTR operator.

## Process

This script is very simple. It uses `oc` to deploy Windup, then checks continuously if the deployment is complete and ready. If it isn't ready, within the specified number of retries (currently 60 retries, around 30 minutes) the script will fail.

## Prerequisite(s)

### Infrastructure
calebevans marked this conversation as resolved.
Show resolved Hide resolved

- A provisioned test cluster to target.
- This cluster should have a namespace that matches $WINDUP_NAMESPACE or the default namespace of "mtr"
- This cluster should have enough space to hold a volume the size of $WINDUP_VOLUME_CAP or the default of "5Gi"

### Environment Variables

- `WINDUP_NAMESPACE`
- **Definition**: Namespace to deploy Windup in.
- **If left empty**: Will use the "mtr" namespace.
- `WINDUP_VOLUME_CAP`
- **Definition**: Windup volume capacity.
- **If left empty**: Will use a "5Gi" volume capacity.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

# Deploy windup
echo "Deploying Windup"
oc apply -f - <<EOF
apiVersion: windup.jboss.org/v1
kind: Windup
metadata:
name: mtr
namespace: $WINDUP_NAMESPACE
labels:
application: mtr
spec:
volumeCapacity: "$WINDUP_VOLUME_CAP"
EOF

# Check if Windup is deployed

# Sleep for 5 seconds to wait for the resource to be created
sleep 5

RETRIES=60
for try in $(seq "$RETRIES"); do
READY=$(oc get windup -n mtr -o=jsonpath='{.items[0].status.conditions[1].status}')
if [[ $READY == "True" ]]; then
echo "Windup is ready."
break
else
if [ $try == $RETRIES ]; then
echo "Error deploying Windup, exiting now"
exit 1
fi
echo "Try ${try}/${RETRIES}: Windup deployment is not ready. Checking again in 30 seconds"
sleep 30
fi
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"path": "mtr/deploy-windup/mtr-deploy-windup-ref.yaml",
"owners": {
"approvers": [
"cspi-qe-ocp-lp",
"sshveta",
"stillalearner"
],
"reviewers": [
"cspi-qe-ocp-lp",
"sshveta",
"stillalearner"
]
}
}