From 5c81951449bcd9e7edc41811f016253678b9a2d1 Mon Sep 17 00:00:00 2001 From: quicksilver Date: Mon, 2 Aug 2021 17:07:24 +0800 Subject: [PATCH] Add the arguments of skip build Milvus image in e2e-k8s.sh (#6947) Signed-off-by: quicksilver --- tests/scripts/e2e-k8s.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/tests/scripts/e2e-k8s.sh b/tests/scripts/e2e-k8s.sh index 8cf7f4195f..467e2d671c 100755 --- a/tests/scripts/e2e-k8s.sh +++ b/tests/scripts/e2e-k8s.sh @@ -85,6 +85,10 @@ while (( "$#" )); do SKIP_BUILD=true shift ;; + --skip-build-image) + SKIP_BUILD_IMAGE=true + shift + ;; --skip-test) SKIP_TEST=true shift @@ -150,7 +154,9 @@ Usage: --skip-cleanup Skip cleanup KinD cluster - --skip-build Skip build Milvus image + --skip-build Skip build Milvus binary + + --skip-build-image Skip build Milvus image --skip-test Skip e2e test @@ -205,12 +211,6 @@ export SINGLE_CLUSTER_NAME="${SINGLE_CLUSTER_NAME:-kind}" export HUB="${HUB:-milvusdb}" export TAG="${TAG:-latest}" -# If we're not intending to pull from an actual remote registry, use the local kind registry -if [[ -z "${SKIP_BUILD:-}" ]]; then - HUB="${KIND_REGISTRY}" - export HUB -fi - export CI="true" if [[ ! -d "${ARTIFACTS}" ]];then @@ -275,12 +275,23 @@ if [[ -z "${SKIP_SETUP:-}" ]]; then fi if [[ -z "${SKIP_BUILD:-}" ]]; then - export MILVUS_IMAGE_REPO="${HUB}/milvus" - export MILVUS_IMAGE_TAG="${TAG}" - trace "setup kind registry" setup_kind_registry pushd "${ROOT}" trace "build milvus" "${ROOT}/build/builder.sh" /bin/bash -c "${BUILD_COMMAND}" + popd +fi + +if [[ -z "${SKIP_BUILD_IMAGE:-}" ]]; then + # If we're not intending to pull from an actual remote registry, use the local kind registry + running="$(docker inspect -f '{{.State.Running}}' "${KIND_REGISTRY_NAME}" 2>/dev/null || true)" + if [[ "${running}" == 'true' ]]; then + HUB="${KIND_REGISTRY}" + export HUB + fi + export MILVUS_IMAGE_REPO="${HUB}/milvus" + export MILVUS_IMAGE_TAG="${TAG}" + + pushd "${ROOT}" trace "build milvus image" "${ROOT}/build/build_image.sh" trace "push milvus image" docker push "${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG}" popd