Commit 1a6ec5cf by Philip ABBET

Initial commit

parents
Pipeline #6375 failed with stage
in 6 minutes 12 seconds
*~
*.swp
.nfs*
beat.env.python*
\ No newline at end of file
stages:
- build
- deploy
variables:
DOCKER_REGISTRY: docker.idiap.ch
CONTAINER_NAME: $DOCKER_REGISTRY/$CI_PROJECT_PATH:$CI_BUILD_REF_NAME
DEPLOY_NAME: $DOCKER_REGISTRY/$CI_PROJECT_PATH:latest
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN docker.idiap.ch
- sed -i "s/git@gitlab.idiap.ch:/https:\/\/gitlab-ci-token:${CI_BUILD_TOKEN}@gitlab.idiap.ch\//" .gitmodules
- git submodule sync
- git submodule update --init --recursive
- sed -i "s/https:\/\/gitlab-ci-token:${CI_BUILD_TOKEN}@gitlab.idiap.ch\//git@gitlab.idiap.ch:/" .gitmodules
build:
stage: build
script:
- cp /home/gitlab-runner/.ssh/id_rsa* .
- ./build.sh $CONTAINER_NAME "gitlab-ci-token:${CI_BUILD_TOKEN}"
# - docker push $CONTAINER_NAME # No automatic upload at the moment
- docker images $CONTAINER_NAME
after_script:
- rm -f id_rsa*
environment:
name: registry
tags:
- docker-build
# Deploys `latest` tag
deploy:
stage: deploy
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
script:
- docker pull $CONTAINER_NAME
- docker tag $CONTAINER_NAME $DEPLOY_NAME
# - docker push $DEPLOY_NAME # No automatic upload at the moment
environment:
name: registry
tags:
- docker-build
[submodule "scripts"]
path = scripts
url = git@gitlab.idiap.ch:beat/beat.env.scripts.git
###############################################################################
# #
# Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.backend.python module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
FROM debian:8.4
MAINTAINER Andre Anjos <andre.anjos@idiap.ch>
# the destination directory that will contain the 'execute' environment
ARG destdir=/usr/local/beat
# the tarball containing the environment, with a Makefile that can build it
ARG tarball
ADD $tarball $destdir
# this is the bare minimum to install on debian base
RUN set -ex \
&& build_deps=' \
cmake \
dh-autoreconf \
gcc \
gfortran \
libatlas-dev \
libc-dev \
libfreetype6-dev \
libgomp1 \
libjpeg-dev \
liblapack-dev \
libpq-dev \
libreadline-dev \
make \
pkg-config \
unzip \
wget \
' \
&& runtime_deps=' \
libatlas3-base \
libffi6 \
libfreetype6 \
libjpeg62-turbo \
libreadline6 \
' \
&& apt-get update \
&& apt-get install -y $build_deps \
&& make -C $destdir download \
&& make -C $destdir \
&& rm -rf $destdir/pkg $destdir/log \
&& apt-get purge -y --auto-remove $build_deps \
&& apt-get install -y $runtime_deps \
&& rm -rf /var/lib/apt/lists/*
# at this point, the image is pretty much built
ENV PATH $destdir/bin:$PATH
# BEAT Python environment
This package contains docker instructions for building a container for the Python
backend of the BEAT platform.
It is tightly integrated to Gitlab CI. By default, it will build and update a
new container on the registry, named after the branch or release tag. Upon a
tag, the container will also be uploaded as `latest`.
## Usage
To test the creation of a container on your machine, run the following command:
```sh
$ ./build.sh
```
#!/usr/bin/env bash
# Default values
PROJECT_REPOSITORY=git@gitlab.idiap.ch:beat/beat.env.python27
PROJECT_BRANCH=master
IMAGE_NAME=beat.env.python
IMAGE_TAG=master
REGISTRY=docker.idiap.ch/beat
# Customisation from the command-line, used mainly by the CI
if [ $# > 0 ]; then
IFS=:
read image_fullname IMAGE_TAG <<< "$1"
REGISTRY=${image_fullname%/*}
IMAGE_NAME=${image_fullname##*/}
fi
if [ $# == 2 ]; then
PROJECT_REPOSITORY="https://${2}@gitlab.idiap.ch/${PROJECT_REPOSITORY##*:}"
fi
# Build the image
./scripts/build.sh "${PROJECT_REPOSITORY}" $PROJECT_BRANCH $IMAGE_NAME $IMAGE_TAG $REGISTRY
Subproject commit 76b97c9d80f92021a879df7dbeab48196ed2c076
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