diff --git a/ci-operator/config/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master.yaml b/ci-operator/config/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master.yaml index 3b2184a5d0600..1605ecbc6202c 100644 --- a/ci-operator/config/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master.yaml +++ b/ci-operator/config/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master.yaml @@ -1,8 +1,14 @@ base_images: base: + from: "docker.io/kubevirtplatformipi/ocp-release-dev:kubevirt-provider-tag-4.7-1" name: "4.7" namespace: ocp tag: base +# test_installer: +# from: "docker.io/kubevirtplatformipi/installer:dbarda" +# name: test_installer +# namespace: ocp +# tag: test_installer ocp_builder_rhel-8-golang-1.15-openshift-4.6: name: builder namespace: ocp @@ -27,7 +33,7 @@ images: inputs: ocp_builder_rhel-8-golang-1.15-openshift-4.6: as: - - registry.svc.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.6 + - docker.io/kubevirtplatformipi/ocp-release-dev:kubevirt-provider-tag-4.7-1 to: kubevirt-machine-controllers promotion: name: "4.7" @@ -53,6 +59,10 @@ tests: commands: IS_CONTAINER=TRUE make fmt container: from: src +- as: e2e-kubevirt + steps: + cluster_profile: gcp + workflow: openshift-e2e-kubevirt zz_generated_metadata: branch: master org: openshift diff --git a/ci-operator/jobs/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master-presubmits.yaml b/ci-operator/jobs/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master-presubmits.yaml index 79fe4a887d9ee..3c45c6ab981e8 100644 --- a/ci-operator/jobs/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master-presubmits.yaml +++ b/ci-operator/jobs/openshift/cluster-api-provider-kubevirt/openshift-cluster-api-provider-kubevirt-master-presubmits.yaml @@ -1,5 +1,70 @@ presubmits: openshift/cluster-api-provider-kubevirt: + - agent: kubernetes + always_run: true + branches: + - master + cluster: build01 + context: ci/prow/e2e-kubevirt + decorate: true + decoration_config: + skip_cloning: true + labels: + ci-operator.openshift.io/prowgen-controlled: "true" + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-cluster-api-provider-kubevirt-master-e2e-kubevirt + rerun_command: /test e2e-kubevirt + spec: + containers: + - args: + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --lease-server-password-file=/etc/boskos/password + - --report-password-file=/etc/report/password.txt + - --report-username=ci + - --secret-dir=/usr/local/e2e-kubevirt-cluster-profile + - --target=e2e-kubevirt + command: + - ci-operator + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /usr/local/e2e-kubevirt-cluster-profile + name: cluster-profile + - 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: password + path: password + secretName: boskos-credentials + - name: cluster-profile + projected: + sources: + - secret: + name: cluster-secrets-gcp + - configMap: + name: cluster-profile-gcp + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )e2e-kubevirt,?($|\s.*) - agent: kubernetes always_run: true branches: diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/env/OWNERS b/ci-operator/step-registry/ipi/conf/kubevirt/env/OWNERS new file mode 100644 index 0000000000000..86c772e13fcac --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/env/OWNERS @@ -0,0 +1,6 @@ +approvers: + - bardielle + - ravidbro + - nirarg + - rgolangh + - chenyosef diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-commands.sh b/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-commands.sh new file mode 100755 index 0000000000000..95d353145d53f --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-commands.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +cluster_name=${NAMESPACE}-${JOB_NAME_HASH} + +out=${SHARED_DIR}/install-config.yaml + +if [[ -z "$RELEASE_IMAGE_LATEST" ]]; then + echo "RELEASE_IMAGE_LATEST is an empty string, exiting" + exit 1 +fi + +echo "Installing from release ${RELEASE_IMAGE_LATEST}" + +ssh_pub_key=$(<"${CLUSTER_PROFILE_DIR}/ssh-publickey") +pull_secret=$(<"${CLUSTER_PROFILE_DIR}/pull-secret") + +cat > "${out}" << EOF +apiVersion: v1 +metadata: + name: ${cluster_name} +pullSecret: > + ${pull_secret} +sshKey: | + ${ssh_pub_key} +EOF diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.metadata.json b/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.metadata.json new file mode 100644 index 0000000000000..21e7d4ecde822 --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.metadata.json @@ -0,0 +1,12 @@ +{ + "path": "ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.yaml", + "owners": { + "approvers": [ + "bardielle", + "ravidbro", + "nirarg", + "rgolangh", + "chenyosef" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.yaml b/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.yaml new file mode 100644 index 0000000000000..6250f6444e295 --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.yaml @@ -0,0 +1,17 @@ +ref: + as: ipi-conf-kubevirt-env + from_image: + namespace: origin + name: centos + tag: '8' + commands: ipi-conf-kubevirt-env-commands.sh + resources: + requests: + cpu: 10m + memory: 100Mi + env: + - name: RELEASE_IMAGE_LATEST + default: "docker.io/kubevirtplatformipi/installer:dbarda" +# default: "docker.io/kubevirtplatformipi/ocp-release-dev:kubevirt-provider-tag-4.7-1" + documentation: |- + The IPI configure step generates the generic portions of the install-config.yaml file based on optional input files. diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/install/OWNERS b/ci-operator/step-registry/ipi/conf/kubevirt/install/OWNERS new file mode 100644 index 0000000000000..86c772e13fcac --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/install/OWNERS @@ -0,0 +1,6 @@ +approvers: + - bardielle + - ravidbro + - nirarg + - rgolangh + - chenyosef diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-commands.sh b/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-commands.sh new file mode 100755 index 0000000000000..ba553a304db3a --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-commands.sh @@ -0,0 +1,81 @@ +#!/bin/bash -x +set -o nounset +set -o errexit +set -o pipefail + +trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM + +if [[ -z "$OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE" ]]; then + echo "OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE is an empty string, exiting" + exit 1 +fi + +echo "**** 1 Installing from release ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" +export SSH_PRIV_KEY_PATH=${CLUSTER_PROFILE_DIR}/ssh-privatekey +export PULL_SECRET_PATH=${CLUSTER_PROFILE_DIR}/pull-secret +export OPENSHIFT_INSTALL_INVOKER=openshift-internal-ci/${JOB_NAME}/${BUILD_ID} +export HOME=/tmp + +case "${CLUSTER_TYPE}" in +aws) export AWS_SHARED_CREDENTIALS_FILE=${CLUSTER_PROFILE_DIR}/.awscred;; +azure4) export AZURE_AUTH_LOCATION=${CLUSTER_PROFILE_DIR}/osServicePrincipal.json;; +gcp) export GOOGLE_CLOUD_KEYFILE_JSON=${CLUSTER_PROFILE_DIR}/gce.json;; +kubevirt) export KUBEVIRT_KUBECONFIG=${HOME}/.kube/config;; +vsphere) ;; +openstack) export OS_CLIENT_CONFIG_FILE=${CLUSTER_PROFILE_DIR}/clouds.yaml ;; +openstack-vexxhost) export OS_CLIENT_CONFIG_FILE=${CLUSTER_PROFILE_DIR}/clouds.yaml ;; +*) echo >&2 "Unsupported cluster type '${CLUSTER_TYPE}'" +esac + +echo "**** 2 " $PWD + +dir=/tmp/installer +mkdir "${dir}/" +cp "${SHARED_DIR}/install-config.yaml" "${dir}/" + +# move private key to ~/.ssh/ so that installer can use it to gather logs on +# bootstrap failure +mkdir -p ~/.ssh +cp "${SSH_PRIV_KEY_PATH}" ~/.ssh/ + +echo "**** 3 " +ls + +#sleep 2h +echo "curl from dropbox" +curl -k -L https://www.dropbox.com/s/vwkw15z7a47pwlt/openshift-install?dl=0 -o openshift-install-binary +#OPENSHIFT_INSTALL_BINARY=$(curl -k -L https://www.dropbox.com/s/vwkw15z7a47pwlt/openshift-install?dl=0) + + +echo "chmod" +chmod +x openshift-install-binary + +echo "run create manifest" +openshift-install-binary --dir="${dir}" create manifests & +#openshift-install --dir="${dir}" create manifests & + +wait "$!" + +sed -i '/^ channel:/d' "${dir}/manifests/cvo-overrides.yaml" + +while IFS= read -r -d '' item +do + manifest="$( basename "${item}" )" + cp "${item}" "${dir}/manifests/${manifest##manifest_}" +done < <( find "${SHARED_DIR}" -name "manifest_*.yml" -print0) + +TF_LOG=debug openshift-install --dir="${dir}" create cluster 2>&1 | grep --line-buffered -v password & + +set +e +wait "$!" +ret="$?" +cp "${dir}"/log-bundle-*.tar.gz "${ARTIFACT_DIR}/" 2>/dev/null +set -e + +sed 's/password: .*/password: REDACTED/' "${dir}/.openshift_install.log" >"${ARTIFACT_DIR}/.openshift_install.log" +cp \ + -t "${SHARED_DIR}" \ + "${dir}/auth/kubeconfig" \ + "${dir}/auth/kubeadmin-password" \ + "${dir}/metadata.json" +exit "$ret" diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.metadata.json b/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.metadata.json new file mode 100644 index 0000000000000..69138c88955b0 --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.metadata.json @@ -0,0 +1,12 @@ +{ + "path": "ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.yaml", + "owners": { + "approvers": [ + "bardielle", + "ravidbro", + "nirarg", + "rgolangh", + "chenyosef" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.yaml b/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.yaml new file mode 100644 index 0000000000000..288a6e9d2951d --- /dev/null +++ b/ci-operator/step-registry/ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.yaml @@ -0,0 +1,24 @@ +ref: + as: ipi-conf-kubevirt-install + from: installer +# from_image: +# name: test_installer +# namespace: ocp +# tag: test_installer + commands: ipi-conf-kubevirt-install-commands.sh + resources: + requests: + cpu: 1000m + memory: 2Gi +# dependencies: +# - name: "release:latest" +# env: OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE +# - name: "release:latest" +# env: RELEASE_IMAGE_LATEST + env: + - name: OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE + default: "docker.io/kubevirtplatformipi/installer:dbarda" + - name: CLUSTER_TYPE + default: "kubevirt" + documentation: |- + The IPI install step runs the OpenShift Installer in order to bring up an OpenShift cluster, using the provided cluster profile to choose a target IaaS platform. Anything that needs to be configured using manifests should generate them before this step and put them in the SHARED_DIR with the filename manifest_(manifest_name).yml so that this step can pull in the manifest in. diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-chain.yaml b/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-chain.yaml index c0001ee9c7c8b..24b8fb1984c91 100644 --- a/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-chain.yaml +++ b/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-chain.yaml @@ -1,7 +1,7 @@ chain: as: ipi-conf-kubevirt steps: - - ref: ipi-conf + - ref: ipi-conf-kubevirt-env - ref: ipi-conf-kubevirt documentation: >- This chain generates an install-config.yaml file configured to run clusters in the Kubevirt CI project. diff --git a/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-commands.sh b/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-commands.sh index 5d1ef6ab8ed64..d444e6510d8e5 100755 --- a/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-commands.sh +++ b/ci-operator/step-registry/ipi/conf/kubevirt/ipi-conf-kubevirt-commands.sh @@ -30,3 +30,4 @@ platform: persistentVolumeAccessMode: ${KUBEVIRT_VOLUME_ACCESS_MODE} EOF +cat ${CONFIG} \ No newline at end of file diff --git a/ci-operator/step-registry/ipi/install/kubevirt/OWNERS b/ci-operator/step-registry/ipi/install/kubevirt/OWNERS new file mode 100644 index 0000000000000..86c772e13fcac --- /dev/null +++ b/ci-operator/step-registry/ipi/install/kubevirt/OWNERS @@ -0,0 +1,6 @@ +approvers: + - bardielle + - ravidbro + - nirarg + - rgolangh + - chenyosef diff --git a/ci-operator/step-registry/ipi/install/kubevirt/ipi-install-kubevirt-chain.metadata.json b/ci-operator/step-registry/ipi/install/kubevirt/ipi-install-kubevirt-chain.metadata.json new file mode 100644 index 0000000000000..1d1c2079e4b95 --- /dev/null +++ b/ci-operator/step-registry/ipi/install/kubevirt/ipi-install-kubevirt-chain.metadata.json @@ -0,0 +1,12 @@ +{ + "path": "ipi/install/kubevirt/ipi-install-kubevirt-chain.yaml", + "owners": { + "approvers": [ + "bardielle", + "ravidbro", + "nirarg", + "rgolangh", + "chenyosef" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/ipi/install/kubevirt/ipi-install-kubevirt-chain.yaml b/ci-operator/step-registry/ipi/install/kubevirt/ipi-install-kubevirt-chain.yaml new file mode 100644 index 0000000000000..d78e5b3e9163a --- /dev/null +++ b/ci-operator/step-registry/ipi/install/kubevirt/ipi-install-kubevirt-chain.yaml @@ -0,0 +1,7 @@ +chain: + as: ipi-install-kubevirt + steps: + - ref: ipi-install-rbac + - ref: ipi-conf-kubevirt-install + documentation: |- + The IPI install step chain contains all the individual steps necessary to install an OpenShift cluster. \ No newline at end of file diff --git a/ci-operator/step-registry/ipi/kubevirt/post/ipi-kubevirt-post-chain.yaml b/ci-operator/step-registry/ipi/kubevirt/post/ipi-kubevirt-post-chain.yaml index 8544a680c0097..402a621fad8b6 100644 --- a/ci-operator/step-registry/ipi/kubevirt/post/ipi-kubevirt-post-chain.yaml +++ b/ci-operator/step-registry/ipi/kubevirt/post/ipi-kubevirt-post-chain.yaml @@ -1,7 +1,6 @@ chain: as: ipi-kubevirt-post steps: - - chain: ipi-conf-kubevirt - chain: ipi-deprovision documentation: |- The IPI cleanup step contains all steps that deprovision an OpenShift diff --git a/ci-operator/step-registry/ipi/kubevirt/pre/ipi-kubevirt-pre-chain.yaml b/ci-operator/step-registry/ipi/kubevirt/pre/ipi-kubevirt-pre-chain.yaml index 428d1e85c978b..01c9f992d9a8d 100644 --- a/ci-operator/step-registry/ipi/kubevirt/pre/ipi-kubevirt-pre-chain.yaml +++ b/ci-operator/step-registry/ipi/kubevirt/pre/ipi-kubevirt-pre-chain.yaml @@ -2,7 +2,7 @@ chain: as: ipi-kubevirt-pre steps: - chain: ipi-conf-kubevirt - - chain: ipi-install + - chain: ipi-install-kubevirt documentation: |- The IPI setup step contains all steps that provision an OpenShift cluster with a default configuration on Kubevirt. diff --git a/ci-operator/step-registry/openshift/e2e/kubevirt/OWNERS b/ci-operator/step-registry/openshift/e2e/kubevirt/OWNERS new file mode 100644 index 0000000000000..5392ab32be812 --- /dev/null +++ b/ci-operator/step-registry/openshift/e2e/kubevirt/OWNERS @@ -0,0 +1,6 @@ +approvers: + - bardielle + - ravidbro + - nirarg + - rgolangh + - chenyosef \ No newline at end of file diff --git a/ci-operator/step-registry/openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.metadata.json b/ci-operator/step-registry/openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.metadata.json new file mode 100644 index 0000000000000..1094d622710be --- /dev/null +++ b/ci-operator/step-registry/openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.metadata.json @@ -0,0 +1,12 @@ +{ + "path": "openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.yaml", + "owners": { + "approvers": [ + "bardielle", + "ravidbro", + "nirarg", + "rgolangh", + "chenyosef" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.yaml b/ci-operator/step-registry/openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.yaml new file mode 100644 index 0000000000000..8e707dd636dd9 --- /dev/null +++ b/ci-operator/step-registry/openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.yaml @@ -0,0 +1,12 @@ +workflow: + as: openshift-e2e-kubevirt + steps: + pre: + - chain: ipi-kubevirt-pre + test: + - ref: openshift-e2e-test + post: + - chain: gather-core-dump + - chain: ipi-kubevirt-post + documentation: |- + The Openshift E2E KubeVirt workflow executes the common end-to-end test suite on KubeVirt with a default cluster configuration. \ No newline at end of file