Skip to content
Snippets Groups Projects
Commit 89420718 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[ci] Making it work for deployment

parent 4f391f93
No related branches found
No related tags found
No related merge requests found
Pipeline #25804 failed
...@@ -10,3 +10,5 @@ quiet: true #!final ...@@ -10,3 +10,5 @@ quiet: true #!final
show_channel_urls: true #!final show_channel_urls: true #!final
anaconda_upload: false #!final anaconda_upload: false #!final
ssl_verify: false #!final ssl_verify: false #!final
channels:
- defaults
...@@ -108,7 +108,7 @@ install_miniconda() { ...@@ -108,7 +108,7 @@ install_miniconda() {
check_defined CONDA_ROOT check_defined CONDA_ROOT
check_defined CI_PROJECT_DIR check_defined CI_PROJECT_DIR
export CONDARC=${CONDA_ROOT}/condarc export CONDARC="${CONDA_ROOT}/condarc"
check_defined CONDARC check_defined CONDARC
# checks if a conda installation exists. Otherwise, installs one # checks if a conda installation exists. Otherwise, installs one
...@@ -120,33 +120,24 @@ run_cmd mkdir -p ${CONDA_ROOT}/pkgs ...@@ -120,33 +120,24 @@ run_cmd mkdir -p ${CONDA_ROOT}/pkgs
run_cmd touch ${CONDA_ROOT}/pkgs/urls run_cmd touch ${CONDA_ROOT}/pkgs/urls
run_cmd touch ${CONDA_ROOT}/pkgs/urls.txt run_cmd touch ${CONDA_ROOT}/pkgs/urls.txt
CONDA_CHANNEL_ROOT=http://www.idiap.ch/public/conda
check_defined CONDA_CHANNEL_ROOT
run_cmd cp -fv ${CI_PROJECT_DIR}/bob/devtools/data/base-condarc ${CONDARC} run_cmd cp -fv ${CI_PROJECT_DIR}/bob/devtools/data/base-condarc ${CONDARC}
echo "channels:" >> ${CONDARC}
if [ "${1}" == "beta" ]; then
echo " - ${CONDA_CHANNEL_ROOT}/label/beta" >> ${CONDARC}
fi
echo " - ${CONDA_CHANNEL_ROOT}" >> ${CONDARC}
echo " - defaults" >> ${CONDARC}
# displays contents of our configuration
echo "Contents of \`${CONDARC}':" echo "Contents of \`${CONDARC}':"
cat ${CONDARC} cat ${CONDARC}
# setup conda-channels
CONDA_CHANNEL_ROOT="http://www.idiap.ch/public/conda"
check_defined CONDA_CHANNEL_ROOT
CONDA_CLI_CHANNELS="-c ${CONDA_CHANNEL_ROOT} -c defaults"
# creates a base installation depending on the purpose # creates a base installation depending on the purpose
if [ "${1}" == "build" ]; then if [ "${1}" == "build" ]; then
run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3 run_cmd ${CONDA_ROOT}/bin/conda install -n base python conda=4 conda-build=3
elif [ "${1}" == "local" ]; then elif [ "${1}" == "local" ]; then
if [ "$(uname -s)" == "Linux" ]; then run_cmd ${CONDA_ROOT}/bin/conda index ${CONDA_ROOT}/conda-bld
_os="linux-64" CONDA_CLI_CHANNELS="-c ${CONDA_ROOT}/conda-bld ${CONDA_CLI_CHANNELS}"
else run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools
_os="osx-64"
fi
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" ${CONDA_ROOT}/conda-bld/${_os}/bob.devtools-*.tar.bz2
elif [ "${1}" == "beta" ] || [ "${1}" == "stable" ]; then elif [ "${1}" == "beta" ] || [ "${1}" == "stable" ]; then
run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" bob.devtools run_cmd ${CONDA_ROOT}/bin/conda create -n "${2}" --override-channels ${CONDA_CLI_CHANNELS} bob.devtools
else else
log_error "Bootstrap with 'build', or 'local|beta|stable <name>'" log_error "Bootstrap with 'build', or 'local|beta|stable <name>'"
log_error "The value '${1}' is not currently supported" log_error "The value '${1}' is not currently supported"
......
...@@ -47,7 +47,7 @@ check_defined PYTHON_VERSION ...@@ -47,7 +47,7 @@ check_defined PYTHON_VERSION
export DOCSERVER=http://www.idiap.ch export DOCSERVER=http://www.idiap.ch
check_defined DOCSERVER check_defined DOCSERVER
export CONDARC=${CONDA_ROOT}/condarc export CONDARC="${CONDA_ROOT}/condarc"
check_defined CONDARC check_defined CONDARC
export BOB_PACKAGE_VERSION=`cat version.txt | tr -d '\n'`; export BOB_PACKAGE_VERSION=`cat version.txt | tr -d '\n'`;
...@@ -59,21 +59,25 @@ run_cmd conda activate base ...@@ -59,21 +59,25 @@ run_cmd conda activate base
export PATH export PATH
check_defined PATH check_defined PATH
CONDA_CHANNEL_ROOT="${DOCSERVER}/public/conda"
check_defined CONDA_CHANNEL_ROOT
if [ -z "${CI_COMMIT_TAG}" ]; then #building beta if [ -z "${CI_COMMIT_TAG}" ]; then #building beta
channel="http://www.idiap.ch/public/conda/label/beta" UPLOAD_CHANNEL="${CONDA_CHANNEL_ROOT}/label/beta"
else else
channel="http://www.idiap.ch/public/conda" UPLOAD_CHANNEL="${CONDA_CHANNEL_ROOT}"
fi fi
check_defined UPLOAD_CHANNEL
log_info "$ ${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${channel} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION}" log_info "$ ${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${UPLOAD_CHANNEL} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION}"
export BOB_BUILD_NUMBER=$(${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${channel} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION}) export BOB_BUILD_NUMBER=$(${CONDA_ROOT}/bin/python ${CI_PROJECT_DIR}/ci/nextbuild.py ${UPLOAD_CHANNEL} ${CI_PROJECT_NAME} ${BOB_PACKAGE_VERSION} ${PYTHON_VERSION})
check_defined BOB_BUILD_NUMBER check_defined BOB_BUILD_NUMBER
# copy the recipe_append.yaml over before build # copy the recipe_append.yaml over before build
run_cmd cp ${CI_PROJECT_DIR}/bob/devtools/data/recipe_append.yaml conda/ run_cmd cp ${CI_PROJECT_DIR}/bob/devtools/data/recipe_append.yaml conda/
run_cmd cp ${CI_PROJECT_DIR}/bob/devtools/data/conda_build_config.yaml conda/ run_cmd cp ${CI_PROJECT_DIR}/bob/devtools/data/conda_build_config.yaml conda/
run_cmd ${CONDA_ROOT}/bin/conda build "--python=${PYTHON_VERSION} --no-anaconda-upload" conda # to build, we only rely on the stable channel and defaults
run_cmd ${CONDA_ROOT}/bin/conda build --override-channels -c "${CONDA_CHANNEL_ROOT} -c defaults --python=${PYTHON_VERSION} --no-anaconda-upload" conda
# run git clean to clean everything that is not needed. This helps to keep the # run git clean to clean everything that is not needed. This helps to keep the
# disk usage on CI machines to minimum. # disk usage on CI machines to minimum.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment