Skip to content

Commit

Permalink
feat(SRVKP-3566): openshift-pipelines performance CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhutar committed Oct 18, 2023
1 parent e0f4f93 commit c699518
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ci-operator/config/openshift-pipelines/performance/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
approvers:
- jhutar
- khrm
options: {}
reviewers:
- jhutar
- khrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
build_root:
image_stream_tag:
name: release
namespace: openshift
tag: golang-1.18
images:
- dockerfile_literal: |-
FROM src
SHELL ["/bin/bash", "-c"]
# Install jq, yq, kubectl, help and vcluster
RUN curl -Lso /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && chmod +x /usr/local/bin/jq
RUN curl -Lso /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.25.2/yq_linux_amd64 && chmod +x /usr/local/bin/yq
RUN curl -Lso /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
RUN yum install -y httpd-tools parallel
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh && helm version
RUN curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/download/v0.15.0/vcluster-linux-amd64" && install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster && vcluster --version
from: src
to: openshift-pipelines-performance-runner
releases:
latest:
release:
architecture: amd64
channel: fast
version: "4.12"
resources:
'*':
limits:
cpu: 1000m
memory: 2Gi
requests:
cpu: 1000m
memory: 2Gi
tests:
- as: scaling-pipelines-daily
cron: 0 2,14 * * *
steps:
cluster_profile: aws
workflow: openshift-pipelines-scaling-pipelines
timeout: 8h0m0s
- as: scaling-pipelines
steps:
cluster_profile: aws
workflow: openshift-pipelines-scaling-pipelines
timeout: 8h0m0s
zz_generated_metadata:
branch: master
org: openshift-pipelines
repo: performance
13 changes: 13 additions & 0 deletions ci-operator/jobs/openshift-pipelines/performance/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# DO NOT EDIT; this file is auto-generated using https://github.com/openshift/ci-tools.
# Fetched from https://github.com/openshift-pipelines/operator root OWNERS
# If the repo had OWNERS_ALIASES then the aliases were expanded
# Logins who are not members of 'openshift' organization were filtered out
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md

approvers:
- jhutar
- khrm
options: {}
reviewers:
- jhutar
- khrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
periodics:
- agent: kubernetes
cluster: build05
cron: 0 2,14 * * *
decorate: true
decoration_config:
skip_cloning: true
timeout: 8h0m0s
extra_refs:
- base_ref: master
org: openshift-pipelines
repo: performance
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-openshift-pipelines-performance-master-scaling-pipelines-daily
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/scaling-pipelines-daily-cluster-profile
- --target=scaling-pipelines-daily
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/scaling-pipelines-daily-cluster-profile
name: cluster-profile
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/manifest-tool
name: manifest-tool-local-pusher
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
- name: manifest-tool-local-pusher
secret:
secretName: manifest-tool-local-pusher
- 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,138 @@
presubmits:
openshift-pipelines/performance:
- agent: kubernetes
always_run: true
branches:
- ^master$
- ^master-
cluster: build03
context: ci/prow/images
decorate: true
decoration_config:
skip_cloning: true
labels:
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-pipelines-performance-master-images
rerun_command: /test 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]
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/manifest-tool
name: manifest-tool-local-pusher
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: manifest-tool-local-pusher
secret:
secretName: manifest-tool-local-pusher
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )images,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
- ^master$
- ^master-
cluster: build01
context: ci/prow/scaling-pipelines
decorate: true
decoration_config:
skip_cloning: true
timeout: 8h0m0s
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-pipelines-performance-master-scaling-pipelines
rerun_command: /test scaling-pipelines
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/scaling-pipelines-cluster-profile
- --target=scaling-pipelines
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/scaling-pipelines-cluster-profile
name: cluster-profile
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/manifest-tool
name: manifest-tool-local-pusher
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
- name: manifest-tool-local-pusher
secret:
secretName: manifest-tool-local-pusher
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )scaling-pipelines,?($|\s.*)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
approvers:
- jhutar
- khrm
options: {}
reviewers:
- jhutar
- khrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

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

OPENSHIFT_API="$(yq e '.clusters[0].cluster.server' "$KUBECONFIG")"
OPENSHIFT_USERNAME="kubeadmin"

export OPENSHIFT_PASSWORD
export BYOC_KUBECONFIG

export OPENSHIFT_API
export OPENSHIFT_USERNAME

echo -e "[INFO] Start tests"

yq -i 'del(.clusters[].cluster.certificate-authority-data) | .clusters[].cluster.insecure-skip-tls-verify=true' "$KUBECONFIG"
if [[ -s "$KUBEADMIN_PASSWORD_FILE" ]]; then
OPENSHIFT_PASSWORD="$(cat "$KUBEADMIN_PASSWORD_FILE")"
elif [[ -s "${SHARED_DIR}/kubeadmin-password" ]]; then
# Recommendation from hypershift qe team in slack channel..
OPENSHIFT_PASSWORD="$(cat "${SHARED_DIR}/kubeadmin-password")"
else
echo "Kubeadmin password file is empty... Aborting job"
exit 1
fi

timeout --foreground 5m bash <<-"EOF"
while ! oc login "$OPENSHIFT_API" -u "$OPENSHIFT_USERNAME" -p "$OPENSHIFT_PASSWORD" --insecure-skip-tls-verify=true; do
sleep 20
done
EOF
if [ $? -ne 0 ]; then
echo "Timed out waiting for login"
exit 1
fi

# Define a new environment for BYOC pointing to a kubeconfig with token. RHTAP environments only supports kubeconfig with token:
# See: https://issues.redhat.com/browse/GITOPSRVCE-554
BYOC_KUBECONFIG="/tmp/token-kubeconfig"
cp "$KUBECONFIG" "$BYOC_KUBECONFIG"
if [[ -s "$BYOC_KUBECONFIG" ]]; then
echo -e "byoc kubeconfig exists!"
else
echo "Kubeconfig not exists in $BYOC_KUBECONFIG... Aborting job"
exit 1
fi

cd "$(mktemp -d)"
git clone --branch master https://github.com/openshift-pipelines/performance.git .

# Collect load test results at the end
trap './ci-scripts/collect-results.sh; trap EXIT' SIGINT EXIT

# Setup Tekton cluster
./ci-scripts/setup-cluster.sh

# Execute load test
./ci-scripts/load-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"path": "openshift-pipelines/scaling-pipelines/openshift-pipelines-scaling-pipelines-ref.yaml",
"owners": {
"approvers": [
"jhutar",
"khrm"
],
"reviewers": [
"jhutar",
"khrm"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ref:
as: openshift-pipelines-scaling-pipelines
best_effort: true
grace_period: 300s
cli: latest
timeout: 8h0m0s
commands: openshift-pipelines-scaling-pipelines-commands.sh
credentials:
- mount_path: /usr/local/ci-secrets/openshift-pipelines-perfscale
name: openshift-pipelines-perfscale
namespace: test-credentials
from: openshift-pipelines-performance-runner
resources:
requests:
cpu: 3000m
memory: 6Gi
Loading

0 comments on commit c699518

Please sign in to comment.