diff --git a/ci/jenkins/test.sh b/ci/jenkins/test.sh index 39ececc0e3d..a42e3222064 100755 --- a/ci/jenkins/test.sh +++ b/ci/jenkins/test.sh @@ -201,8 +201,12 @@ function clean_antrea { for antrea_yml in ${WORKDIR}/*.yml; do kubectl delete -f $antrea_yml --ignore-not-found=true || true done - docker images --format "{{.Repository}}:{{.Tag}}" | grep 'antrea'| xargs -r docker rmi || true - docker images | grep '' | awk '{print $3}' | xargs -r docker rmi || true + if [[ $TESTBED_TYPE == "kind-flexible-ipam" || $TESTBED_TYPE == "kind" ]]; then + docker images --format "{{.Repository}}:{{.Tag}}" | grep 'antrea' | grep -Ev 'antrea/toolbox:latest|antrea/ubuntu:22.04|antrea/golang:1.23' | xargs -r docker rmi || true + else + docker images --format "{{.Repository}}:{{.Tag}}" | grep 'antrea'| xargs -r docker rmi -f || true + docker images | grep '' | awk '{print $3}' | xargs -r docker rmi || true + fi check_and_cleanup_docker_build_cache } @@ -535,26 +539,38 @@ function deliver_antrea { export GOROOT=${GOLANG_RELEASE_DIR}/go export GOCACHE="${WORKSPACE}/../gocache" export PATH=${GOROOT}/bin:$PATH - + echo "debug-1" git show --numstat make clean - ${CLEAN_STALE_IMAGES} + echo "debug-2" + if [[ $TESTBED_TYPE != "kind" ]]; then + if [[ $TESTBED_TYPE != "kind-flexible-ipam" ]]; then + ${CLEAN_STALE_IMAGES} + fi + fi ${PRINT_DOCKER_STATUS} + echo "debug-3" if [[ ! "${TESTCASE}" =~ "e2e" && "${DOCKER_REGISTRY}" != "" ]]; then docker pull "${DOCKER_REGISTRY}/antrea/systemd-logs:v0.4" docker tag "${DOCKER_REGISTRY}/antrea/systemd-logs:v0.4" "antrea/systemd-logs:v0.4" + echo "debug-4" fi + echo "debug-5" chmod -R g-w build/images/ovs chmod -R g-w build/images/base + echo "debug-6" if [[ "$BUILD_TAG" != "latest" ]]; then DOCKER_REGISTRY="${DOCKER_REGISTRY}" ./hack/build-antrea-linux-all.sh --build-tag ${BUILD_TAG} --pull IMG_TAG="${BUILD_TAG}" ./hack/generate-manifest.sh $MANIFEST_ARGS > build/yamls/antrea.yml + echo "debug-7" else + echo "$DOCKER_REGISTRY" DOCKER_REGISTRY="${DOCKER_REGISTRY}" ./hack/build-antrea-linux-all.sh --pull ./hack/generate-manifest.sh $MANIFEST_ARGS > build/yamls/antrea.yml fi + echo "debug-9" make flow-aggregator-image - + echo "debug-10" # Enable verbose log for troubleshooting. sed -i "s/--v=0/--v=4/g" build/yamls/antrea.yml diff --git a/hack/build-antrea-linux-all.sh b/hack/build-antrea-linux-all.sh index f0eb68dd8d2..da96db631ce 100755 --- a/hack/build-antrea-linux-all.sh +++ b/hack/build-antrea-linux-all.sh @@ -137,12 +137,15 @@ fi # image! if $PULL; then if [[ ${DOCKER_REGISTRY} == "" ]]; then + echo "debug-12" docker pull $PLATFORM_ARG ubuntu:22.04 docker pull $PLATFORM_ARG golang:$GO_VERSION else - docker pull ${DOCKER_REGISTRY}/antrea/ubuntu:22.04 + echo "debug-13" + echo "${DOCKER_REGISTRY}" + # docker pull ${DOCKER_REGISTRY}/antrea/ubuntu:22.04 docker tag ${DOCKER_REGISTRY}/antrea/ubuntu:22.04 ubuntu:22.04 - docker pull ${DOCKER_REGISTRY}/antrea/golang:$GO_VERSION + # docker pull ${DOCKER_REGISTRY}/antrea/golang:$GO_VERSION docker tag ${DOCKER_REGISTRY}/antrea/golang:$GO_VERSION golang:$GO_VERSION fi if [ "$DISTRO" == "ubi" ]; then