diff --git a/ci-operator/step-registry/osac-project/installer/component/OWNERS b/ci-operator/step-registry/osac-project/installer/component/OWNERS new file mode 100644 index 0000000000000..423362005a084 --- /dev/null +++ b/ci-operator/step-registry/osac-project/installer/component/OWNERS @@ -0,0 +1,5 @@ +approvers: +- osac-cicd +options: {} +reviewers: +- osac-cicd diff --git a/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-commands.sh b/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-commands.sh new file mode 100644 index 0000000000000..17c7da907deae --- /dev/null +++ b/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-commands.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +echo "************ osac-installer-component commands ************" +echo "--- Running with the following parameters ---" +echo "E2E_NAMESPACE: ${E2E_NAMESPACE}" +echo "E2E_KUSTOMIZE_OVERLAY: ${E2E_KUSTOMIZE_OVERLAY}" +echo "E2E_VM_TEMPLATE: ${E2E_VM_TEMPLATE}" +echo "OSAC_INSTALLER_IMAGE: ${OSAC_INSTALLER_IMAGE}" +echo "COMPONENT_IMAGE: ${COMPONENT_IMAGE}" +echo "COMPONENT_IMAGE_NAME: ${COMPONENT_IMAGE_NAME}" +echo "AAP_EE_IMAGE_OVERRIDE: ${AAP_EE_IMAGE_OVERRIDE:-}" +echo "-------------------------------------------" + +base64 -d /var/run/osac-installer-aap/license > /tmp/license.zip + +timeout -s 9 10m scp -F "${SHARED_DIR}/ssh_config" /tmp/license.zip ci_machine:/tmp/license.zip + +timeout -s 9 120m ssh -F "${SHARED_DIR}/ssh_config" ci_machine bash - << EOF|& sed -e 's/.*auths\{0,1\}".*/*** PULL_SECRET ***/g' + +export KUBECONFIG=\$(find \${KUBECONFIG} -type f -print -quit) + +oc annotate sc lvms-vg1 storageclass.kubernetes.io/is-default-class=true --overwrite + +echo "Waiting for OpenShift Virtualization to be ready..." +oc wait --for=condition=Available hyperconverged/kubevirt-hyperconverged -n openshift-cnv --timeout=900s + +cat < \${COMPONENT_IMAGE}" +cd /installer/base + +if ! grep -Fq "name: \${COMPONENT_IMAGE_NAME}" kustomization.yaml; then + echo "ERROR: image name \${COMPONENT_IMAGE_NAME} not found in /installer/base/kustomization.yaml" >&2 + cat kustomization.yaml >&2 + exit 1 +fi + +if grep -A1 "name: \${COMPONENT_IMAGE_NAME}" kustomization.yaml | grep -q "newName:"; then + sed -i "\#name: \${COMPONENT_IMAGE_NAME}#,/newTag:/{ + s|newName:.*|newName: \${COMPONENT_REGISTRY}| + s|newTag:.*|newTag: \${COMPONENT_TAG}| + }" kustomization.yaml +else + sed -i "\#name: \${COMPONENT_IMAGE_NAME}#{ + a\\ newName: \${COMPONENT_REGISTRY} + n + s|newTag:.*|newTag: \${COMPONENT_TAG}| + }" kustomization.yaml +fi + +if ! grep -Fq "\${COMPONENT_REGISTRY}" kustomization.yaml || ! grep -Fq "newTag: \${COMPONENT_TAG}" kustomization.yaml; then + echo "ERROR: kustomize image override failed — expected \${COMPONENT_REGISTRY}:\${COMPONENT_TAG}" >&2 + cat kustomization.yaml >&2 + exit 1 +fi + +if [ -n "\${AAP_EE_IMAGE_OVERRIDE}" ]; then + overlay_file="/installer/overlays/\${INSTALLER_KUSTOMIZE_OVERLAY}/kustomization.yaml" + if ! grep -q "AAP_EE_IMAGE=" "\${overlay_file}"; then + echo "ERROR: AAP_EE_IMAGE entry not found in \${overlay_file}" >&2 + exit 1 + fi + echo "Overriding AAP_EE_IMAGE -> \${COMPONENT_IMAGE}" + sed -i "s|AAP_EE_IMAGE=.*|AAP_EE_IMAGE=\${COMPONENT_IMAGE}|" "\${overlay_file}" +fi + +cd /installer +sh scripts/setup.sh +' + +EOF diff --git a/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-ref.metadata.json b/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-ref.metadata.json new file mode 100644 index 0000000000000..d126d5daa3c9d --- /dev/null +++ b/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-ref.metadata.json @@ -0,0 +1,11 @@ +{ + "path": "osac-project/installer/component/osac-project-installer-component-ref.yaml", + "owners": { + "approvers": [ + "osac-cicd" + ], + "reviewers": [ + "osac-cicd" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-ref.yaml b/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-ref.yaml new file mode 100644 index 0000000000000..825cc1e43073d --- /dev/null +++ b/ci-operator/step-registry/osac-project/installer/component/osac-project-installer-component-ref.yaml @@ -0,0 +1,34 @@ +ref: + as: osac-project-installer-component + from: dev-scripts + dependencies: + - name: osac-installer + env: OSAC_INSTALLER_IMAGE + - name: component-image + env: COMPONENT_IMAGE + grace_period: 10m + timeout: 3h0m0s + commands: osac-project-installer-component-commands.sh + resources: + requests: + cpu: 100m + memory: 200Mi + credentials: + - namespace: test-credentials + name: osac-installer-aap + mount_path: /var/run/osac-installer-aap + env: + - name: E2E_NAMESPACE + default: "osac-e2e-ci" + documentation: The namespace to use for the e2e tests + - name: E2E_KUSTOMIZE_OVERLAY + default: "vmaas-ci" + documentation: The kustomize overlay to use for the e2e tests + - name: E2E_VM_TEMPLATE + default: "osac.templates.ocp_virt_vm" + documentation: The template to use for the e2e tests + - name: COMPONENT_IMAGE_NAME + documentation: The image name in base/kustomization.yaml to replace (e.g. ghcr.io/osac-project/fulfillment-service) + - name: AAP_EE_IMAGE_OVERRIDE + default: "" + documentation: If non-empty, also override AAP_EE_IMAGE in the overlay kustomization to use COMPONENT_IMAGE diff --git a/ci-operator/step-registry/osac-project/ofcir/baremetal/component/OWNERS b/ci-operator/step-registry/osac-project/ofcir/baremetal/component/OWNERS new file mode 100644 index 0000000000000..423362005a084 --- /dev/null +++ b/ci-operator/step-registry/osac-project/ofcir/baremetal/component/OWNERS @@ -0,0 +1,5 @@ +approvers: +- osac-cicd +options: {} +reviewers: +- osac-cicd diff --git a/ci-operator/step-registry/osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.metadata.json b/ci-operator/step-registry/osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.metadata.json new file mode 100644 index 0000000000000..4d748eaa533e5 --- /dev/null +++ b/ci-operator/step-registry/osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.metadata.json @@ -0,0 +1,11 @@ +{ + "path": "osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.yaml", + "owners": { + "approvers": [ + "osac-cicd" + ], + "reviewers": [ + "osac-cicd" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.yaml b/ci-operator/step-registry/osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.yaml new file mode 100644 index 0000000000000..0071366aada01 --- /dev/null +++ b/ci-operator/step-registry/osac-project/ofcir/baremetal/component/osac-project-ofcir-baremetal-component-workflow.yaml @@ -0,0 +1,23 @@ +workflow: + as: osac-project-ofcir-baremetal-component + steps: + cluster_profile: packet-assisted + allow_best_effort_post_steps: true + allow_skip_on_success: true + pre: + - ref: ofcir-acquire + - ref: assisted-ofcir-setup + - chain: assisted-common-pre + - ref: osac-project-installer-component + test: + - ref: osac-project-baremetal-test + post: + - ref: ofcir-gather + - ref: ofcir-release + env: + CLUSTERTYPE: "assisted_medium_el9" + documentation: |- + This workflow executes the common end-to-end osac-test-infra test suite on a cluster + provisioned by running assisted-installer on a packet server. Unlike the base workflow, + this variant overrides a single component image with a CI-built version from a PR, + enabling E2E validation of component repo changes before merge.