Skip to content

Commit

Permalink
add Dockerfiles for OpenQL testing images
Browse files Browse the repository at this point in the history
  • Loading branch information
slavoutich committed Sep 9, 2018
1 parent 0eaa973 commit ac40bd1
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 2 deletions.
60 changes: 58 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]

stages:
- build
- test

variables:
OPENQL_STABLE_TAG: "0.5"

before_script:
- mkdir -p /root/.docker
- |
echo "{\"auths\": {
\"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"}
\"username\": \"gitlab-ci-token\",
\"password\": \"$CI_BUILD_TOKEN\"}
}
}" > /root/.docker/config.json
- cat /root/.docker/config.json
Expand All @@ -26,9 +33,58 @@ build base conda image:on-schedule:
extends: .docker-base-conda-template
only:
variables:
# For weekly schedules
- $SCHEDULE_FREQUENCY == "weekly"
# kaniko bug https://github.com/GoogleContainerTools/kaniko/issues/245
allow_failure: true

build base conda image:manual:
extends: .docker-base-conda-template
when: manual

.docker-conda-template:
stage: build
script:
- /kaniko/executor
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/docker/Dockerfile.conda
--destination $CI_REGISTRY_IMAGE/testing_conda:$CI_REF
--build-arg GITHUB_PULL_USER=$GITHUB_PULL_USER
--build-arg GITHUB_PULL_TOKEN=$GITHUB_PULL_TOKEN
--build-arg OPENQL_REVISION=$OPENQL_REVISION

build stable conda image:master:
extends: .docker-conda-template
variables:
OPENQL_REVISION: $OPENQL_STABLE_TAG
only:
- master@dicarlolab/pycqed
- tags

build stable conda image:manual:
extends: .docker-conda-template
variables:
OPENQL_REVISION: $OPEQL_STABLE_TAG
when: manual
# kaniko bug https://github.com/GoogleContainerTools/kaniko/issues/342
allow_failure: true

build develop conda image:on-schedule:
extends: .docker-conda-template
variables:
CI_REF: "openql_develop"
OPENQL_REVISION: "develop"
only:
# for daily schedules
- schedules
# kaniko bug https://github.com/GoogleContainerTools/kaniko/issues/342
allow_failure: true

build develop conda image:manual:
extends: .docker-conda-template
variables:
CI_REF: "openql_develop"
OPENQL_REVISION: "develop"
when: manual
# kaniko bug https://github.com/GoogleContainerTools/kaniko/issues/342
allow_failure: true
2 changes: 2 additions & 0 deletions docker/Dockerfile.base_conda
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ ENV LC_ALL C.UTF-8

RUN apt-get update && \
apt-get install --yes \
cmake \
gcc \
g++ \
make \
swig && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
16 changes: 16 additions & 0 deletions docker/Dockerfile.conda
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM registry.gitlab.com/dicarlolab/pycqed/base_conda:latest

ARG GITHUB_PULL_USER
ARG GITHUB_PULL_TOKEN
ARG OPENQL_REVISION

RUN mkdir /src && \
cd /src && \
git clone "https://$GITHUB_PULL_USER:$GITHUB_PULL_TOKEN@github.com/QE-Lab/OpenQL" openql && \
cd openql && \
git checkout $OPENQL_REVISION && \
python setup.py build && \
pip install . && \
cd / && \
rm -rf /src/openql

Empty file removed docker/Dockerfile.stable_conda
Empty file.

0 comments on commit ac40bd1

Please sign in to comment.