aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml61
-rw-r--r--AUTHORS3
-rw-r--r--Dockerfile70
3 files changed, 134 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f0b55cac..2134c15e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,7 @@
+stages:
+ - test
+ - build_container
+
build-cmake:
image: fedora:32
script:
@@ -27,3 +31,60 @@ build-meson-nohdf5:
- dnf install -y meson
- meson build -Dhdf5=disabled && ninja -C build
- ninja -C build test
+
+build_container_image:
+ stage: build_container
+ only:
+ - master
+ image:
+ name: gcr.io/kaniko-project/executor:debug
+ entrypoint: [ "" ]
+
+ variables:
+ IMAGE: "crystfel"
+ IMAGE_TAG_LATEST: "latest"
+ IMAGE_TAG_SHA: $CI_COMMIT_SHORT_SHA
+ DOCKER_HOST: tcp://docker:2375
+ DOCKER_TLS_CERTDIR: ""
+
+ script:
+ - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+ - >
+ /kaniko/executor
+ --context $CI_PROJECT_DIR
+ --dockerfile $CI_PROJECT_DIR/Dockerfile
+ --destination $CI_REGISTRY_IMAGE/$IMAGE:$IMAGE_TAG_LATEST
+ --destination $CI_REGISTRY_IMAGE/$IMAGE:$IMAGE_TAG_SHA
+ --build-arg HELM_VERSION=$HELM_VERSION
+ --build-arg RANCHER_CLI_VERSION=$RANCHER_CLI_VERSION
+
+ tags:
+ - kubernetes
+
+build_container_image_tag:
+ stage: build_container
+ image:
+ name: gcr.io/kaniko-project/executor:debug
+ entrypoint: [ "" ]
+
+ variables:
+ IMAGE: "crystfel"
+ IMAGE_TAG_VER: $CI_COMMIT_TAG
+ DOCKER_HOST: tcp://docker:2375
+ DOCKER_TLS_CERTDIR: ""
+
+ script:
+ - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+ - >
+ /kaniko/executor
+ --context $CI_PROJECT_DIR
+ --dockerfile $CI_PROJECT_DIR/Dockerfile
+ --destination $CI_REGISTRY_IMAGE/$IMAGE:$IMAGE_TAG_VER
+ --build-arg HELM_VERSION=$HELM_VERSION
+ --build-arg RANCHER_CLI_VERSION=$RANCHER_CLI_VERSION
+
+ tags:
+ - kubernetes
+
+ rules:
+ - if: $CI_COMMIT_TAG
diff --git a/AUTHORS b/AUTHORS
index da5a19f1..862c32c7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -109,3 +109,6 @@
* Nicholas Devenish <ndevenish@gmail.com>
Build system bug fixing
+
+* Silvan Schön <silvan.schoen@cfel.de>
+ Container images and CI
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..9b64b61a
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,70 @@
+FROM debian:buster
+
+RUN apt-get update && apt-get install -y \
+ pkg-config \
+ cmake \
+ build-essential \
+ libhdf5-dev \
+ libgsl-dev \
+ libgtk-3-dev \
+ libcairo2-dev \
+ libeigen3-dev \
+ libpango1.0-dev \
+ libgdk-pixbuf2.0-dev \
+ libfftw3-dev \
+ libncurses-dev \
+ libpng-dev \
+ libtiff5-dev \
+ git \
+ flex \
+ bison \
+ libzmq3-dev \
+ libmsgpack-dev \
+ python3-dev \
+ python3-pip \
+ unzip \
+ wget \
+ curl \
+ ninja-build \
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /root
+RUN pip3 install meson
+
+WORKDIR /home/crystfel-build
+
+# Mosflm
+RUN wget -nv https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver740/pre-built/mosflm-linux-64-noX11.zip
+RUN unzip mosflm-linux-64-noX11.zip
+RUN mv mosflm-linux-64-noX11 /usr/local/bin/mosflm
+
+# CrystFEL
+RUN git clone https://gitlab.desy.de/thomas.white/crystfel.git
+RUN cd crystfel && meson build -Dprefix=/usr/local
+RUN cd crystfel && ninja -C build
+RUN cd crystfel && ninja -C build test
+RUN cd crystfel && ninja -C build install
+
+## Stage 2
+FROM debian:buster-slim
+RUN apt-get update && apt-get install -y \
+ libhdf5-103 \
+ libgsl23 \
+ libgtk-3-0 \
+ libcairo2 \
+ libpango1.0 \
+ libgdk-pixbuf2.0 \
+ libfftw3-double3 \
+ libncurses6 \
+ libpng16-16 \
+ libtiff5 \
+ libzmq5 \
+ libmsgpackc2 \
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
+COPY --from=0 /usr/local /usr/local
+
+# Environment variable needed for CrystFEL GUI and Mosflm
+# The file is installed by libccp4c, a wrapped subproject of CrystFEL
+ENV SYMINFO=/usr/share/ccp4/syminfo.lib
+
+RUN ldconfig