Currently, only one CI build can be started at the same time due to we only have only one testing cluster. This PR aims to enable multiple concurrent builds can be triggered to reduce the waiting time for CI builds. The major changes listed below: 1. Each build generate unique images for testing and debugging 2. Check whether the testing cluster is being used by another build. 3. Cache docker image & go mod after build finished 4. Improve dockerfiles for reusing docker build cache
34 lines
1.4 KiB
Bash
Executable File
34 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Unbound variables cause failure, so this readable if block instead of Parameter Expansion
|
|
if [[ ${TRAVIS_EVENT_TYPE+NOVALUE} == "cronNOVALUE" ]]
|
|
then
|
|
echo "Skipping build & test, this is cron job for fission upgrade tests"
|
|
exit 0
|
|
fi
|
|
|
|
if [ ! -f ${HOME}/.kube/config ]
|
|
then
|
|
echo "Skipping end to end tests, no cluster credentials"
|
|
exit 0
|
|
fi
|
|
|
|
source $(dirname $0)/test_utils.sh
|
|
|
|
dump_system_info
|
|
|
|
setupCIBuildEnv
|
|
|
|
mkdir -p ${DOCKER_CACHE_DIR}
|
|
|
|
docker save $(docker history -q $REPO/python-env:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/python-env.tar.gz || true
|
|
docker save $(docker history -q $REPO/jvm-env:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/jvm-env.tar.gz || true
|
|
docker save $(docker history -q $REPO/go-env:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/go-env.tar.gz || true
|
|
docker save $(docker history -q $REPO/tensorflow-serving-env:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/tensorflow-serving-env.tar.gz || true
|
|
|
|
docker save $(docker history -q $REPO/python-env-builder:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/python-builder.tar.gz || true
|
|
docker save $(docker history -q $REPO/jvm-env-builder:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/jvm-builder.tar.gz || true
|
|
docker save $(docker history -q $REPO/go-env-builder:$TAG | grep -v '<missing>') | gzip > ${DOCKER_CACHE_DIR}/go-builder.tar.gz || true
|