diff --git a/tests/scripts/e2e-k8s.sh b/tests/scripts/e2e-k8s.sh index 8cf7f4195f811549b91e3b62c777112fbd895eef..467e2d671cd602f0e4d9672f7438cc19d7e83a26 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 + 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}" - trace "setup kind registry" setup_kind_registry pushd "${ROOT}" - trace "build milvus" "${ROOT}/build/builder.sh" /bin/bash -c "${BUILD_COMMAND}" trace "build milvus image" "${ROOT}/build/build_image.sh" trace "push milvus image" docker push "${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG}" popd