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

Quarkus scenario onboarding #40279

Merged
merged 22 commits into from
Jul 10, 2023
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
12 changes: 12 additions & 0 deletions ci-operator/config/quarkus-qe/quarkus-test-suite/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The OWNERS file is used by prow to automatically merge approved PRs.

approvers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda


reviewers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda
49 changes: 49 additions & 0 deletions ci-operator/config/quarkus-qe/quarkus-test-suite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# quarkus-qe-quarkus-test-suite<!-- 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 - `quarkus-interop-aws`](#test-setup-execution-and-reporting-results---quarkus-interop-aws)
- [Prerequisite(s)](#prerequisites)
- [Environment Variables](#environment-variables)
- [Custom Images](#custom-images)

## General Information

- **TestRepository**: [quarkus-qe/quarkus-test-suite](https://github.com/quarkus-qe/quarkus-test-suite)

## Purpose

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

## Process

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

1. Provision a test cluster on AWS
2. Deploy and Execute tests and archive results
3. Deprovision the 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 - `quarkus-interop-aws`

Following the test cluster being provisioned, the following dockerfile is used to execute tests:

- The dockerfile to build the image and execute tests is defined at https://github.com/quarkus-qe/quarkus-test-suite/blob/main/.openshift-interop/Dockerfile.

## 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.
- `FIREWATCH_CONFIG`
- **Definition**: The firewatch [configuration](https://github.com/CSPI-QE/firewatch/blob/main/docs/cli_usage_guide.md#defining-the-configuration) needed for firewatch tool to creates Jira issues for failed OpenShift CI jobs.

### Custom Images
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
base_images:
cli:
name: "4.14"
namespace: ocp
tag: cli
build_root:
image_stream_tag:
name: release
namespace: openshift
tag: golang-1.19
images:
- context_dir: .openshift-interop/
to: quarkus-runner
releases:
latest:
candidate:
product: ocp
stream: nightly
version: "4.14"
resources:
'*':
requests:
cpu: 200m
memory: 200Mi
tests:
- as: quarkus-interop-aws
cron: 0 6 * * 1
steps:
cluster_profile: aws-cspi-qe
env:
BASE_DOMAIN: cspilp.interop.ccitredhat.com
FIREWATCH_CONFIG: |
[
{"step": "ipi-*", "failure_type": "all", "classification": "Infrastructure Provisioning - Cluster", "jira_project": "LPTOCPCI", "jira_epic":"LPTOCPCI-290"},
{"step": "gather-*", "failure_type": "all", "classification": "Other", "jira_project": "LPTOCPCI", "jira_epic": "LPTOCPCI-290"},
{"step": "openshift-*", "failure_type": "all", "classification": "Other", "jira_project": "LPTOCPCI", "jira_epic":"LPTOCPCI-290"},
{"step": "quarkus-execute-tests", "failure_type": "pod_failure", "classification": "Test Execution", "jira_project": "LPTOCPCI", "jira_epic":"LPTOCPCI-290"},
{"step": "quarkus-execute-tests", "failure_type": "test_failure", "classification": "Test Failure", "jira_project": "QQE", "jira_epic":"LPTOCPCI-290"}
]
FIREWATCH_DEFAULT_JIRA_PROJECT: LPTOCPCI
FIREWATCH_JIRA_SERVER: https://issues.redhat.com
test:
- ref: quarkus-execute-tests
workflow: firewatch-ipi-aws
zz_generated_metadata:
branch: main
org: quarkus-qe
repo: quarkus-test-suite
variant: quarkus-ocp4.14-lp-interop
12 changes: 12 additions & 0 deletions ci-operator/jobs/quarkus-qe/quarkus-test-suite/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The OWNERS file is used by prow to automatically merge approved PRs.

approvers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda


reviewers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
periodics:
- agent: kubernetes
cluster: build03
cron: 0 6 * * 1
decorate: true
decoration_config:
skip_cloning: true
extra_refs:
- base_ref: main
org: quarkus-qe
repo: quarkus-test-suite
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws-cspi-qe
ci-operator.openshift.io/variant: quarkus-ocp4.14-lp-interop
ci.openshift.io/generator: prowgen
job-release: "4.14"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-quarkus-qe-quarkus-test-suite-main-quarkus-ocp4.14-lp-interop-quarkus-interop-aws
reporter_config:
slack:
channel: '#quarkus-qe'
job_states_to_report:
- success
- failure
- error
report_template: '{{if eq .Status.State "success"}} :slack-green: Job *{{.Spec.Job}}*
ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> {{else}} :failed:
Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View
logs> {{end}}'
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/quarkus-interop-aws-cluster-profile
- --target=quarkus-interop-aws
- --variant=quarkus-ocp4.14-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/quarkus-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:
quarkus-qe/quarkus-test-suite:
- agent: kubernetes
always_run: true
branches:
- ^main$
- ^main-
cluster: build01
context: ci/prow/quarkus-ocp4.14-lp-interop-images
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/variant: quarkus-ocp4.14-lp-interop
ci.openshift.io/generator: prowgen
job-release: "4.14"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-quarkus-qe-quarkus-test-suite-main-quarkus-ocp4.14-lp-interop-images
rerun_command: /test quarkus-ocp4.14-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=quarkus-ocp4.14-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( | .* )quarkus-ocp4.14-lp-interop-images,?($|\s.*)
10 changes: 10 additions & 0 deletions ci-operator/step-registry/quarkus/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
approvers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda


reviewers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda
10 changes: 10 additions & 0 deletions ci-operator/step-registry/quarkus/execute-tests/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
approvers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda


reviewers:
- cspi-qe-ocp-lp
- fedinskiy
- rsvoboda
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

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

shopt -s nullglob

# Set the ocp env variables and execute oc login
CONSOLE_URL=$(cat $SHARED_DIR/console.url)
OCP_API_URL="https://api.${CONSOLE_URL#"https://console-openshift-console.apps."}:6443"
OCP_CRED_USR="kubeadmin"
OCP_CRED_PSW="$(cat ${SHARED_DIR}/kubeadmin-password)"
oc login ${OCP_API_URL} --username=${OCP_CRED_USR} --password=${OCP_CRED_PSW} --insecure-skip-tls-verify=true

# source sdkman
set +o nounset #disable strict mode
source "/root/.sdkman/bin/sdkman-init.sh"
set -o nounset #enable back strict mode

# export maven env variable
export _JAVA_OPTIONS=-Duser.home=$HOME

# Execute tests
mvn -B -V clean verify -fae \
-Dmaven.repo.local=$PWD/local-repo \
-Dquarkus.platform.group-id=$QUARKUS_PLATFORM_GROUP_ID \
-Dquarkus.platform.artifact-id=$QUARKUS_PLATFORM_ARTIFACT_ID \
-Dquarkus.platform.version=$QUARKUS_VERSION \
-Dquarkus-plugin.version=$QUARKUS_VERSION \
-Proot-modules,http-modules,sql-db-modules,monitoring-modules \
-Dopenshift \
-pl $PROJECTS

# Copy test reports into $ARTIFACT_DIR
echo "Copying results and xmls to ${ARTIFACT_DIR}"
PROJECTS=config,lifecycle-application,http/http-minimum,http/http-minimum-reactive,sql-db/sql-app,monitoring/microprofile-opentracing
for PROJECT in ${PROJECTS//","/" "}; do
for FILE in ./$PROJECT/target/failsafe-reports/*.xml; do
FILENAME=$(basename $FILE)
echo $FILENAME
cp $FILE ${ARTIFACT_DIR}/junit_${FILENAME}
done
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"path": "quarkus/execute-tests/quarkus-execute-tests-ref.yaml",
"owners": {
"approvers": [
"cspi-qe-ocp-lp",
"fedinskiy",
"rsvoboda"
],
"reviewers": [
"cspi-qe-ocp-lp",
"fedinskiy",
"rsvoboda"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ref:
as: quarkus-execute-tests
from: quarkus-runner
commands: quarkus-execute-tests-commands.sh
resources:
requests:
cpu: 300m
memory: 1000Mi
documentation: |-
This ref step is used for test executing and collecting the test results of Red Hat build of Quarkus.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins:
quarkus-qe/quarkus-test-suite:
plugins:
- trigger