Commit 533a6475 authored by André Anjos's avatar André Anjos 💬

[test] Use beat.core.test to pull docker images for testing (c.f. beat.core#63)

parent 1259da32
Pipeline #27144 failed with stage
in 4 minutes and 29 seconds
# This build file uses template features from YAML so it is generic enough for
# any Bob project. Don't modify it unless you know what you're doing.
# Definition of global variables (all stages)
variables:
CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
DOCKER_REGISTRY: docker.idiap.ch
# Definition of our build pipeline order
stages:
- build
- deploy
- pypi
# Build targets
.build_template: &build_job
stage: build
before_script:
- mkdir _ci
- curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
- chmod 755 _ci/install.sh
- ./_ci/install.sh _ci master #installs ci support scripts
- ./_ci/before_build.sh
- docker info
- ./scripts/docker_pull.sh master #pulls required test images
script:
- ./_ci/build.sh
after_script:
- ./_ci/after_build.sh
cache: &build_caches
paths:
- miniconda.sh
- ${CONDA_ROOT}/pkgs/*.tar.bz2
- ${CONDA_ROOT}/pkgs/urls.txt
.build_linux_template: &linux_build_job
<<: *build_job
tags:
- docker-build
image: continuumio/conda-concourse-ci
artifacts:
expire_in: 1 week
paths:
- _ci/
- ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
cache:
<<: *build_caches
key: "linux-cache"
.build_macosx_template: &macosx_build_job
<<: *build_job
tags:
- macosx
artifacts:
expire_in: 1 week
paths:
- _ci/
- ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
cache:
<<: *build_caches
key: "macosx-cache"
build_linux_36:
<<: *linux_build_job
variables:
PYTHON_VERSION: "3.6"
BUILD_EGG: "true"
artifacts:
expire_in: 1 week
paths:
- _ci/
- dist/*.zip
- sphinx
- ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
build_macosx_36:
<<: *macosx_build_job
variables:
PYTHON_VERSION: "3.6"
# Deploy targets
.deploy_template: &deploy_job
stage: deploy
before_script:
- ./_ci/install.sh _ci master #updates ci support scripts
script:
- ./_ci/deploy.sh
dependencies:
- build_linux_36
- build_macosx_36
tags:
- deployer
deploy_beta:
<<: *deploy_job
environment: beta
only:
- master
deploy_stable:
<<: *deploy_job
environment: stable
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
pypi:
stage: pypi
environment: pypi
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
before_script:
- ./_ci/install.sh _ci master #updates ci support scripts
script:
- ./_ci/pypi.sh
dependencies:
- build_linux_36
tags:
- deployer
include:
- 'https://gitlab.idiap.ch/bob/bob.devtools/raw/master/bob/devtools/data/gitlab-ci/single-package.yaml'
- 'https://gitlab.idiap.ch/bob/bob.devtools/raw/master/bob/devtools/data/gitlab-ci/beat-docker-package.yaml'
......@@ -40,6 +40,9 @@ from beat.backend.python.hash import hashDataset
from beat.backend.python.hash import toPath
from beat.core.database import Database
# this will ensure we pull the required images for the tests
from beat.core.test import setup_docker_test_images as setup_module
from .test_algorithms import call as call_algo
from .test_experiments import call as call_xp
from . import prefix, tmp_prefix
......
[buildout]
parts = scripts docker
parts = scripts
eggs = beat.cmdline
develop = .
newest = false
[scripts]
recipe = bob.buildout:scripts
[docker]
recipe = collective.recipe.cmd
cmds = BUILDOUT=true ./scripts/docker_pull.sh master
on_install = true
on_update = true
......@@ -14,8 +14,8 @@ eggs = beat.cmdline
ipdb
[sources]
beat.core = git https://gitlab.idiap.ch/beat/beat.core branch=1.6.x
beat.backend.python = git https://gitlab.idiap.ch/beat/beat.backend.python branch=1.5.x
beat.core = git https://gitlab.idiap.ch/beat/beat.core
beat.backend.python = git https://gitlab.idiap.ch/beat/beat.backend.python
[scripts]
recipe = bob.buildout:scripts
#!/usr/bin/env bash
if [ $# == 0 ]; then
echo "usage: $0 <beat-core-branch>"
exit 1
fi
basedir=`pwd`
if [ ! -e ${basedir}/_ci/functions.sh ]; then
# this will happen when executing buildout for the first time
mkdir ${basedir}/_ci
curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > ${basedir}/_ci/install.sh
chmod 755 ${basedir}/_ci/install.sh
${basedir}/_ci/install.sh ${basedir}/_ci master #installs ci support scripts
else
${basedir}/_ci/install.sh ${basedir}/_ci master #updates ci support scripts
fi
if [ "${BUILDOUT}" == "true" ]; then
# when executing in the context of buildout, define dummies
export CI_PROJECT_URL=https://gitlab.idiap.ch/beat/beat.cmdline
export CI_PROJECT_DIR=beat
export CI_PROJECT_PATH=beat/beat.cmdline
export CI_PROJECT_NAME=beat.cmdline
export CI_COMMIT_REF_NAME=master
export PYPIUSER=pypiuser
export PYPIPASS=pypipass
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
branch=$1
check_env branch
destdir="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd)"
check_env destdir
run_cmd curl -o ${destdir}/_core_docker_pull.sh --silent "https://gitlab.idiap.ch/beat/beat.core/raw/${branch}/scripts/docker_pull.sh"
run_cmd chmod 755 ${destdir}/_core_docker_pull.sh
run_cmd ${destdir}/_core_docker_pull.sh
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