From d0a8a01e0044187da458736e2b807fdaf670624b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 3 Mar 2021 11:46:52 +0100 Subject: [PATCH] ci: pre-pull ROOK_CEPH_CLUSTER_IMAGE if set After the introduction of ROOK_CEPH_CLUSTER_IMAGE in build.env, the additional image needs to get pulled from the CI registry mirror and pushed into the minikube VM. Without this addition, the Docker Hub pull limits may prevent deploying Rook. Signed-off-by: Niels de Vos --- mini-e2e-helm.groovy | 11 +++++++++++ mini-e2e.groovy | 11 +++++++++++ single-node-k8s.sh | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/mini-e2e-helm.groovy b/mini-e2e-helm.groovy index ae2ce1044ed..11a839a966f 100644 --- a/mini-e2e-helm.groovy +++ b/mini-e2e-helm.groovy @@ -144,6 +144,17 @@ node('cico-workspace') { podman_pull(ci_registry, "docker.io", "rook/ceph:${rook_version}") } + def rook_ceph_cluster_image = sh( + script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${ROOK_CEPH_CLUSTER_IMAGE}\'', + returnStdout: true + ).trim() + def d_io_regex = ~"^docker.io/" + + if (rook_ceph_cluster_image != '') { + // single-node-k8s.sh pushes the image into minikube + podman_pull(ci_registry, "docker.io", rook_ceph_cluster_image - d_io_regex) + } + timeout(time: 30, unit: 'MINUTES') { ssh "./single-node-k8s.sh --k8s-version=${k8s_release}" } diff --git a/mini-e2e.groovy b/mini-e2e.groovy index ba55d451696..6edc38fb91d 100644 --- a/mini-e2e.groovy +++ b/mini-e2e.groovy @@ -141,6 +141,17 @@ node('cico-workspace') { podman_pull(ci_registry, "docker.io", "rook/ceph:${rook_version}") } + def rook_ceph_cluster_image = sh( + script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${ROOK_CEPH_CLUSTER_IMAGE}\'', + returnStdout: true + ).trim() + def d_io_regex = ~"^docker.io/" + + if (rook_ceph_cluster_image != '') { + // single-node-k8s.sh pushes the image into minikube + podman_pull(ci_registry, "docker.io", rook_ceph_cluster_image - d_io_regex) + } + timeout(time: 30, unit: 'MINUTES') { ssh "./single-node-k8s.sh --k8s-version=${k8s_release}" } diff --git a/single-node-k8s.sh b/single-node-k8s.sh index 6a6b8621e41..794065d612d 100755 --- a/single-node-k8s.sh +++ b/single-node-k8s.sh @@ -142,6 +142,12 @@ then ./podman2minikube.sh "${BASE_IMAGE}" fi +# Rook also uses ceph/ceph:v15 (build.env:ROOK_CEPH_CLUSTER_IMAGE), so push it into the VM +if [ -n "${ROOK_CEPH_CLUSTER_IMAGE}" ] && podman inspect "${ROOK_CEPH_CLUSTER_IMAGE}" > /dev/null +then + ./podman2minikube.sh "${ROOK_CEPH_CLUSTER_IMAGE}" +fi + deploy_rook # running e2e.test requires librados and librbd