WIP: Conda ci
Ok I have configured some working CI here which uses small conda environments, caches things, and uses conda packages for our test process and upload process.
I have a couple of issues still:
-
upload of packages - Don't know how to upload the files like you did with wheels.
- After a file is uploaded you need to run
conda indexto reflect the new changes.
-
the port process is somewhat explained here: https://gitlab.idiap.ch/bob/bob/wikis/ci-setup-with-conda but needs improvement.
Merge request reports
Activity
Could you please remove
$HOME/.condarcon CI machines. @andre.anjos ?- .conda-recipe/meta.yaml 0 → 100644
38 - libblitz 39 - numpy 40 - coverage 41 - sphinx 42 43 imports: 44 - bob 45 - bob.extension 46 - bob.extension.scripts 47 48 commands: 49 - bob_new_version.py --help 50 - bob_dependecy_graph.py --help 51 - bob_dbmanage.py all download --force || true 52 - python -c "from bob.extension import get_config; print(get_config())" 53 # - coverage run --source=bob.extension `which nosetests` -sv bob.extension # [not osx] These are temporarily commented.
Edited by Amir MOHAMMADI
- bootstrap-conda.sh 0 → 100755
18 else 19 ARCH="Linux-x86_64" 20 fi 21 22 if [[ "$PYTHON_VERSION" == "2.7" ]]; then 23 PYK="2" 24 else 25 PYK="3" 26 fi 27 28 # Create root environment and add basic channels for conda 29 if [ ! -x ${CONDA} ]; then 30 if [ ! -x ${MINICONDA} ]; then 31 mkdir -pv `dirname ${MINICONDA}` 32 echo "[>>] Downloading `basename ${MINICONDA}` -> ${MINICONDA}..." 33 curl --silent https://repo.continuum.io/miniconda/Miniconda${PYK}-latest-${ARCH}.sh --output ${MINICONDA} 13 11 - build 14 12 - test 15 13 - docs 16 - wheels 17 14 - upload 18 15 19 16 # Global variables 20 17 variables: 21 CONDA_PREFIX: env 18 TEST_CHANNEL: file://idiap/group/torch5spro/bob_master_conda_channel 13 11 - build 14 12 - test 15 13 - docs 16 - wheels 17 14 - upload 18 15 19 16 # Global variables 20 17 variables: 21 CONDA_PREFIX: env 18 TEST_CHANNEL: file://idiap/group/torch5spro/bob_master_conda_channel 22 19 20 # Global cache 21 cache: 22 key: "$CI_PROJECT_NAMESPACE/$CI_BUILD_NAME" # per group name and build name Added 1 commit:
- e05c599b - [ci] remove git clean -ffdx
27 29 stage: build 28 30 before_script: 29 31 - git clean -ffdx 30 - curl --silent https://gitlab.idiap.ch/bob/bob/snippets/7/raw | tr -d '\r' > bootstrap-conda.sh 31 - chmod 755 ./bootstrap-conda.sh 32 - ./bootstrap-conda.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX} 32 - ./bootstrap-conda.sh miniconda ${PYTHON_VER} 33 33 variables: &build_variables 34 34 BOB_DOCUMENTATION_SERVER: "http://www.idiap.ch/software/bob/docs/latest/bob/%s/master/" 35 35 script: 36 - ./bin/buildout 37 - ./bin/sphinx-build doc sphinx 38 - ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG} 39 after_script: 40 - rm -rf ${CONDA_PREFIX} 36 - miniconda/bin/conda build --no-test --python=${PYTHON_VER} .conda-recipe 28 30 before_script: 29 31 - git clean -ffdx 30 - curl --silent https://gitlab.idiap.ch/bob/bob/snippets/7/raw | tr -d '\r' > bootstrap-conda.sh 31 - chmod 755 ./bootstrap-conda.sh 32 - ./bootstrap-conda.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX} 32 - ./bootstrap-conda.sh miniconda ${PYTHON_VER} 33 33 variables: &build_variables 34 34 BOB_DOCUMENTATION_SERVER: "http://www.idiap.ch/software/bob/docs/latest/bob/%s/master/" 35 35 script: 36 - ./bin/buildout 37 - ./bin/sphinx-build doc sphinx 38 - ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG} 39 after_script: 40 - rm -rf ${CONDA_PREFIX} 36 - miniconda/bin/conda build --no-test --python=${PYTHON_VER} .conda-recipe 37 - miniconda/bin/conda install -n root --yes ${CI_PROJECT_NAME} Added 1 commit:
- 114c8ab1 - [ci] remove miniconda.sh from artifacts
- .conda-recipe/meta.yaml 0 → 100644
1 {% set version = "master" %} 2 3 package: 4 name: bob.extension 5 version: {{ version }} 6 7 source: 8 git_url: ../ 9 10 build: 11 entry_points: 12 - bob_new_version.py = bob.extension.scripts:new_version 13 - bob_dependecy_graph.py = bob.extension.scripts:dependency_graph 14 number: 0 - bootstrap-conda.sh 0 → 100755
29 if [ ! -x ${CONDA} ]; then 30 if [ ! -x ${MINICONDA} ]; then 31 mkdir -pv `dirname ${MINICONDA}` 32 echo "[>>] Downloading `basename ${MINICONDA}` -> ${MINICONDA}..." 33 curl --silent https://repo.continuum.io/miniconda/Miniconda${PYK}-latest-${ARCH}.sh --output ${MINICONDA} 34 chmod 755 ${MINICONDA} 35 fi 36 37 echo "[>>] Creating root environment and setting basic options..." 38 bash ${MINICONDA} -b -p ${BASEDIR} 39 fi 40 41 echo "[>>] Updating conda in the root environment..." 42 touch ${BASEDIR}/.condarc 43 ${CONDA} config --set show_channel_urls True 44 ${CONDA} install --override-channels -c defaults --yes --quiet -n root conda-build sphinx sphinx_rtd_theme - bootstrap-conda.sh 0 → 100755
36 37 echo "[>>] Creating root environment and setting basic options..." 38 bash ${MINICONDA} -b -p ${BASEDIR} 39 fi 40 41 echo "[>>] Updating conda in the root environment..." 42 touch ${BASEDIR}/.condarc 43 ${CONDA} config --set show_channel_urls True 44 ${CONDA} install --override-channels -c defaults --yes --quiet -n root conda-build sphinx sphinx_rtd_theme 45 ${CONDA} update --override-channels -c defaults --yes --quiet -n root conda 46 ${CONDA} config --add channels conda-forge 47 ${CONDA} config --add channels defaults 48 ${CONDA} config --add channels ${TEST_CHANNEL} 49 ${CONDA} info 50 51 # Function for running command and echoing results - .conda-recipe/meta.yaml 0 → 100644
9 10 build: 11 entry_points: 12 - bob_new_version.py = bob.extension.scripts:new_version 13 - bob_dependecy_graph.py = bob.extension.scripts:dependency_graph 14 number: 0 15 skip: true # [win] 16 script_env: 17 - CFLAGS 18 - CXXFLAGS 19 - LDFLAGS # [osx] 20 - MACOSX_DEPLOYMENT_TARGET # [osx] 21 22 requirements: 23 build: 24 - python pinnings would be added here. I have explained in the guide: https://gitlab.idiap.ch/bob/bob/wikis/ci-setup-with-conda
Added 1 commit:
- 5427cef4 - [ci] test with docker image
Hello,
I finally had the time to look into your suggestion. As of now, packages don't pin their dependencies.
Pinning for all individual packages is probably not a good idea: every time we'll need to do a global update for version numbers, multiple package may have to be touched.
This will potentially generate a lot of work. Or not?
As of today, the packages compile against a cloned version of the environment. If I change the environment on the CIs, then all packages start to compile against the new environment. We had foreseen and implemented (thanks to @tiago.pereira), wheels uploading from the nightlies, what mitigated problems related to the environment changing (API and ABI compatibility issues), allowing us to re-compile the whole system in a single shot. The workflow for updating the environment was: update the CIs (this means 2 machines in the near future or 1 machine + 1 docker container), re-run the nightlies, done.
Now, if you'd like to update the environment, what the workflow will be? From what you're proposing, it will be more like what we had before in which every package will need to be re-compiled in order. I can tell you it will take anyone doing it a few working days, even if they are experienced.
Isn't it possible to, somehow, emulate the "clone" behaviour by caching our required packages on a web-server folder for example? Then, to update the environment, the work would be: update the packages on the web-folder, re-run the nightlies, done. In this way, no specific pinning would be required on the packages.
So you are saying that you always want to test against the tip of conda-forge, am I right? And will not support old packages?
Edited by Amir MOHAMMADIYou can take a look at https://github.com/conda-forge/bob.io.image-feedstock/blob/master/recipe/meta.yaml for pinning example from environment variables.
Would you be kind and generate a list of packages that you download from
conda-forge? I need to give it to them and ask them not to delete them in future. The links are in these files:https://gitlab.idiap.ch/bob/bob.admin/blob/master/linux/devel-py27.txtI would need a list like this:
https://conda.anaconda.org/conda-forge/linux-64/boost-1.61.0-py27_1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ffmpeg-2.8.6-2.tar.bz2There is now a script in
bob.adminto do that. If you clone that package and run it, it will produce the following file list:$ ./conda-forge-keeplist.sh https://conda.anaconda.org/conda-forge/linux-64/boost-1.61.0-py27_1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/boost-1.61.0-py34_1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/boost-1.61.0-py35_1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ffmpeg-2.8.6-2.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/giflib-5.1.2-1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/icu-56.1-4.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ipdb-0.10.1-py27_0.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ipdb-0.10.1-py34_0.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ipdb-0.10.1-py35_0.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/libblitz-0.10-0.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/libmatio-1.5.6-4.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/libsvm-3.21-1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/sox-14.4.2-libpng1.6.22_6.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/vlfeat-0.9.20-1.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/x264-20131217-1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/boost-1.61.0-py27_1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/boost-1.61.0-py34_1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/boost-1.61.0-py35_1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/ffmpeg-2.8.6-2.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/giflib-5.1.2-1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/icu-56.1-4.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/ipdb-0.10.1-py27_0.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/ipdb-0.10.1-py34_0.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/ipdb-0.10.1-py35_0.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/libblitz-0.10-0.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/libmatio-1.5.6-4.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/libsvm-3.21-1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/sox-14.4.2-libpng1.6.22_6.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/vlfeat-0.9.20-1.tar.bz2 https://conda.anaconda.org/conda-forge/osx-64/x264-20131217-1.tar.bz2I have raised an issue here: https://github.com/conda-forge/conda-forge.github.io/issues/220 to keep track of these package deletions. Until then, can we have a backup of them locally?
Writing a script that does these changes automatically would be great. An initial example script would be: https://github.com/conda-forge/conda-forge.github.io/blob/master/scripts/pin_the_slow_way.py
mentioned in issue bob.admin#35 (closed)
changed milestone to %Conda-based CI