Skip to content
Open
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 @@ -9,6 +9,7 @@ workflow:
test:
- ref: openshift-microshift-e2e-metal-tests
post:
- ref: openshift-microshift-infra-pcp-dashboard
- ref: openshift-microshift-infra-pmlogs
- ref: openshift-microshift-infra-sos-aws
- ref: openshift-microshift-infra-aws-deprovision
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
approvers:
- openshift-edge-approvers
options: {}
reviewers:
- openshift-edge-reviewers
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
set -xeuo pipefail
Comment thread
suleymanakbas91 marked this conversation as resolved.

# shellcheck disable=SC1091
source "${SHARED_DIR}/ci-functions.sh"
ci_script_prologue
trap_subprocesses_on_term

EDGE_TOOLING_DIR="${EDGE_TOOLING_DIR:-/opt/app-root/src/edge-tooling}"
PCP_SCRIPTS="${EDGE_TOOLING_DIR}/plugins/microshift-ci/scripts/pcp-graphs"
LOCAL_ARTIFACTS=$(mktemp -d)

# Construct GCS path to the metal-tests step's scenario-info.
# The metal-tests step uploads scenario-info (including pcp-archives.tar) to GCS,
# but these files are no longer on the hypervisor by the time this post step runs.
if [ "${JOB_TYPE}" == "presubmit" ]; then
GCS_JOB_PATH="pr-logs/pull/${REPO_OWNER}_${REPO_NAME}/${PULL_NUMBER}/${JOB_NAME}/${BUILD_ID}"
else
GCS_JOB_PATH="logs/${JOB_NAME}/${BUILD_ID}"
fi
GCS_BASE="gs://test-platform-results/${GCS_JOB_PATH}"

# Find scenario-info path (wildcard handles different workflow names)
SCENARIO_GCS=$(gsutil ls -d "${GCS_BASE}/artifacts/*/openshift-microshift-e2e-metal-tests/artifacts/scenario-info/" 2>/dev/null | head -1 || true)

if [ -n "${SCENARIO_GCS}" ]; then
echo "Downloading VM PCP archives from GCS..."
while IFS= read -r gcs_file; do
rel="${gcs_file#"${SCENARIO_GCS}"}"
mkdir -p "${LOCAL_ARTIFACTS}/$(dirname "${rel}")"
gsutil -q cp "${gcs_file}" "${LOCAL_ARTIFACTS}/${rel}"
done < <(gsutil ls -r "${SCENARIO_GCS}" 2>/dev/null | grep -E '(pcp-archives\.tar|junit\.xml)$')
else
echo "WARNING: could not find scenario-info in GCS at ${GCS_BASE}"
fi

# Copy hypervisor PCP logs if available
PMLOGS_DIR=/var/log/pcp/pmlogger
if ssh "${INSTANCE_PREFIX}" "[ -d \"${PMLOGS_DIR}\" ]" ; then
mkdir -p "${LOCAL_ARTIFACTS}/pmlogs"
if ! scp -r "${INSTANCE_PREFIX}:${PMLOGS_DIR}/"* "${LOCAL_ARTIFACTS}/pmlogs/" ; then
echo "WARNING: failed to copy hypervisor pmlogger data, skipping"
fi
fi

# Generate the interactive PCP dashboard
echo "Generating PCP dashboard..."
bash "${PCP_SCRIPTS}/generate-dashboard.sh" \
--local "${LOCAL_ARTIFACTS}" \
--output "${ARTIFACT_DIR}/custom-link-pcp.html"

rm -rf "${LOCAL_ARTIFACTS}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"path": "openshift/microshift/infra/pcp-dashboard/openshift-microshift-infra-pcp-dashboard-ref.yaml",
"owners": {
"approvers": [
"openshift-edge-approvers"
],
"reviewers": [
"openshift-edge-reviewers"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ref:
as: openshift-microshift-infra-pcp-dashboard
from_image:
namespace: ci
name: edge-tooling-ai-helpers
tag: latest
commands: openshift-microshift-infra-pcp-dashboard-commands.sh
resources:
requests:
cpu: 100m
memory: 200Mi
timeout: 15m
grace_period: 10m
best_effort: true
env:
- name: HOME
default: /tmp/secret
credentials:
- namespace: test-credentials
name: microshift-rhsm-creds
mount_path: /var/run/rhsm/
documentation: |-
Generates an interactive PCP performance dashboard from scenario VM and
hypervisor PCP archives, producing a custom-link-pcp.html artifact that
Spyglass renders as a "Test PCP" toggle in Prow job results.