From 32db348a6fa9b4d31a053c121531d83bcfec582f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mac=C3=ADk?= Date: Thu, 27 Jun 2024 08:19:23 +0200 Subject: [PATCH] chore(RHIDP-2120): Add resoruces for running performance test for Developer Sandbox (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel MacĂ­k --- dev-sandbox/Containerfile | 9 +++++++++ dev-sandbox/mvp.sh | 9 +++++++++ dev-sandbox/rhdh-perf.job.template.yaml | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 dev-sandbox/Containerfile create mode 100755 dev-sandbox/mvp.sh create mode 100644 dev-sandbox/rhdh-perf.job.template.yaml diff --git a/dev-sandbox/Containerfile b/dev-sandbox/Containerfile new file mode 100644 index 0000000..75826d2 --- /dev/null +++ b/dev-sandbox/Containerfile @@ -0,0 +1,9 @@ +FROM registry.access.redhat.com/ubi9/ubi + +ENV RHDH_BASE_URL=localhost + +RUN yum install -y jq && yum clean all + +COPY mvp.sh /tmp/mvp.sh + +CMD /tmp/mvp.sh diff --git a/dev-sandbox/mvp.sh b/dev-sandbox/mvp.sh new file mode 100755 index 0000000..a99f64c --- /dev/null +++ b/dev-sandbox/mvp.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +RHDH_BASE_URL=${RHDH_BASE_URL:-localhost} + +curl="curl -sSL --insecure" + +token=$($curl "${RHDH_BASE_URL}/api/auth/guest/refresh" | jq -r '.backstageIdentity.token') + +$curl -H "Authorization: Bearer $token" "${RHDH_BASE_URL}/api/catalog/entities?filter=kind=api" | jq -r diff --git a/dev-sandbox/rhdh-perf.job.template.yaml b/dev-sandbox/rhdh-perf.job.template.yaml new file mode 100644 index 0000000..497c3d4 --- /dev/null +++ b/dev-sandbox/rhdh-perf.job.template.yaml @@ -0,0 +1,21 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: user-workloads +objects: + - apiVersion: batch/v1 + kind: Job + metadata: + name: rhdh-perf + spec: + template: + spec: + containers: + - name: curl-container + image: quay.io/pmacik-testing/rhdh-perf-testing-client:v1.2 + imagePullPolicy: Always + env: + - name: RHDH_BASE_URL + value: "${RHDH_URL}" + restartPolicy: Never + backoffLimit: 4