Skip to content
Closed
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
@@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 6 additions & 0 deletions ci-operator/step-registry/ipi/conf/kubevirt/env/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- bardielle
- ravidbro
- nirarg
- rgolangh
- chenyosef
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"path": "ipi/conf/kubevirt/env/ipi-conf-kubevirt-env-ref.yaml",
"owners": {
"approvers": [
"bardielle",
"ravidbro",
"nirarg",
"rgolangh",
"chenyosef"
]
}
}
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions ci-operator/step-registry/ipi/conf/kubevirt/install/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- bardielle
- ravidbro
- nirarg
- rgolangh
- chenyosef
Original file line number Diff line number Diff line change
@@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does a file names ipi-conf-kubevirt-install-commands.sh should handle cases of other CLUSTER_TYPES ? I would expect to get the Unsupported cluster type for all types except for kubevirt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side branch for testing our usecase
It's only for testing our image - I must duplicate the commands.sh file but use env variable with our image


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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"path": "ipi/conf/kubevirt/install/ipi-conf-kubevirt-install-ref.yaml",
"owners": {
"approvers": [
"bardielle",
"ravidbro",
"nirarg",
"rgolangh",
"chenyosef"
]
}
}
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ platform:
persistentVolumeAccessMode: ${KUBEVIRT_VOLUME_ACCESS_MODE}
EOF

cat ${CONFIG}
6 changes: 6 additions & 0 deletions ci-operator/step-registry/ipi/install/kubevirt/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- bardielle
- ravidbro
- nirarg
- rgolangh
- chenyosef
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"path": "ipi/install/kubevirt/ipi-install-kubevirt-chain.yaml",
"owners": {
"approvers": [
"bardielle",
"ravidbro",
"nirarg",
"rgolangh",
"chenyosef"
]
}
}
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions ci-operator/step-registry/openshift/e2e/kubevirt/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- bardielle
- ravidbro
- nirarg
- rgolangh
- chenyosef
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"path": "openshift/e2e/kubevirt/openshift-e2e-kubevirt-workflow.yaml",
"owners": {
"approvers": [
"bardielle",
"ravidbro",
"nirarg",
"rgolangh",
"chenyosef"
]
}
}
Loading