Commit f9f4afd7 authored by André Anjos's avatar André Anjos 💬

[ci] Remove outdated C++ algo building (see: #63); Clarify script purpose

parent 46484fa8
......@@ -24,8 +24,7 @@ stages:
- ./_ci/install.sh _ci master #installs ci support scripts
- ./_ci/before_build.sh
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.idiap.ch
- ./scripts/before_test.sh build #pulls required docker images and compiles
- ./scripts/docker_pull.sh #pulls required test images
script:
- ./_ci/build.sh
after_script:
......
......@@ -24,33 +24,23 @@ if [ "${BUILDOUT}" == "true" ]; then
export DOCUSER=docuser
export DOCPASS=docpass
export CONDA_ROOT=${basedir}/miniconda
export DOCKER_REGISTRY=docker.idiap.ch
export DOCSERVER=https://www.idiap.ch/software/bob
fi
source ${basedir}/_ci/functions.sh
if [ -e ${basedir}/bin ]; then
log_info "Found ${basedir}/bin directory, prepending to PATH..."
PATH=${basedir}/bin:${PATH}
export_env PATH
fi
REGISTRY="docker.idiap.ch"
check_env REGISTRY
check_env DOCKER_REGISTRY
# Select here images that are required for minimal operation (or tests)
IMAGES=(
"${REGISTRY}/beat/beat.env.system.python:1.3.0r3"
"${REGISTRY}/beat/beat.env.db.examples:1.4.0r3"
"${REGISTRY}/beat/beat.env.cxx:2.0.0r1"
"${REGISTRY}/beat/beat.env.client:2.0.0r1"
"${DOCKER_REGISTRY}/beat/beat.env.system.python:1.3.0r3"
"${DOCKER_REGISTRY}/beat/beat.env.db.examples:1.4.0r3"
"${DOCKER_REGISTRY}/beat/beat.env.cxx:2.0.0r1"
"${DOCKER_REGISTRY}/beat/beat.env.client:2.0.0r1"
)
check_array_env IMAGES
# Docker image to be used for compiling the algorithm
BEAT_CXX_DEV_ENVIRONMENT="${REGISTRY}/beat/beat.env.client:2.0.0r1"
check_env BEAT_CXX_DEV_ENVIRONMENT
missing=()
log_info "Checking for minimal set of docker images..."
for k in ${IMAGES[@]}; do
......@@ -63,56 +53,21 @@ for k in ${IMAGES[@]}; do
fi
done
# If there are some images missing, ask the user if he wants to download them
# If there are some images missing, download them
if [[ "${#missing[@]}" > 0 ]]; then
# Log in the registry if needed
if [ -z "$CI_SERVER" ]; then
if ! grep -q "${REGISTRY}" ~/.docker/config.json ; then
run_cmd docker login "${REGISTRY}"
fi
else
check_pass CI_BUILD_TOKEN
log_info docker login -u gitlab-ci-token -p "*************" "${REGISTRY}"
docker login -u gitlab-ci-token -p "${CI_BUILD_TOKEN}" "${REGISTRY}"
# Log in the registry if needed
if [ -z "$CI_SERVER" ]; then
if ! grep -q "${DOCKER_REGISTRY}" ~/.docker/config.json ; then
run_cmd docker login "${DOCKER_REGISTRY}"
fi
# Pull the images
for k in "${missing[@]}"; do
run_cmd docker pull ${k}
done
fi
# These are the algorithms that need to be compiled and which we'll test
ALGORITHMS=(
"prefix/algorithms/user/cxx_integers_echo_legacy/1"
"prefix/algorithms/user/cxx_integers_echo_sequential/1"
"prefix/algorithms/user/cxx_integers_echo_autonomous/1"
"prefix/algorithms/user/cxx_integers_echo_analyzer/1"
)
check_array_env ALGORITHMS
# Check where the package root is
if [ "${BUILDOUT}" == "true" ]; then
BEAT_CORE_TEST_DIR="${basedir}/beat/core/test"
else
BEAT_CORE_TEST_DIR=$(python -c 'import beat.core.test as f; import os; print(os.path.abspath(os.path.dirname(f.__file__)))')
fi
check_env BEAT_CORE_TEST_DIR
# Compilation of the algorithms in the list above
if [ "$1" == "build" ]; then
for k in "${ALGORITHMS[@]}"; do
algodir=$(dirname "${k}")
run_cmd docker run --rm --user=$(id -u):$(id -g) --volume="${BEAT_CORE_TEST_DIR}/scripts/build.sh:/build.sh" --volume="${BEAT_CORE_TEST_DIR}/${algodir}:/sources" --workdir="/sources" --entrypoint="bash" "${BEAT_CXX_DEV_ENVIRONMENT}" /build.sh
done
fi
# Cleanup of the compiled algorithms
if [ "$1" == "clean" ]; then
for k in "${ALGORITHMS[@]}"; do
algodir=$(dirname "${k}")
run_cmd rm -f "${BEAT_CORE_TEST_DIR}/${algodir}/*.so"
run_cmd rm -rf "${BEAT_CORE_TEST_DIR}/${algodir}/build/"
else
check_pass CI_BUILD_TOKEN
log_info docker login -u gitlab-ci-token -p "*************" "${DOCKER_REGISTRY}"
docker login -u gitlab-ci-token -p "${CI_BUILD_TOKEN}" "${DOCKER_REGISTRY}"
fi
# Pull the images
for k in "${missing[@]}"; do
run_cmd docker pull ${k}
done
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment