Commit b1130135 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

Merge branch 'new-docker-registry' into 'master'

New docker registry and other CI fixes

See merge request !56
parents c200ecc3 b7d37c94
......@@ -6,8 +6,8 @@ variables:
CRITERION_OPTS: --ignore-warnings
DOCKER_FILE: packaging/docker/Dockerfile.dev
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE: registry.git.rwth-aachen.de/acs/public/villas/villasnode/node
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/villasnode/node-dev
DOCKER_IMAGE: registry.git.rwth-aachen.de/acs/public/villas/node
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev
MAKE_OPTS: -j32
RELEASEVER: 29
......@@ -40,26 +40,32 @@ prepare:raspbian:docker-dev:
extends: prepare:fedora:docker-dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-raspbian
DOCKER_IMAGE_DEV: villas/node-dev-raspbian
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-raspbian
prepare:ubuntu:docker-dev:
extends: prepare:fedora:docker-dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-ubuntu
DOCKER_IMAGE_DEV: villas/node-dev-ubuntu
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-ubuntu
prepare:centos:docker-dev:
extends: prepare:fedora:docker-dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-centos
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-centos
prepare:debian-armhf:docker-dev:
extends: prepare:fedora:docker-dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-debian-multiarch
DOCKER_IMAGE_DEV: villas/node-dev-debian-armhf
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-debian-armhf
DOCKER_OPTS: --build-arg ARCH=armhf --build-arg TRIPLET=arm-linux-gnueabihf
prepare:debian-arm64:docker-dev:
extends: prepare:fedora:docker-dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-debian-multiarch
DOCKER_IMAGE_DEV: villas/node-dev-debian-arm64
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-debian-arm64
DOCKER_OPTS: --build-arg ARCH=arm64 --build-arg TRIPLET=aarch64-linux-gnu
# Stage: build
......@@ -87,26 +93,36 @@ build:fedora-minimal:x86_64:
build:ubuntu:x86_64:
extends: build:fedora:x86_64
variables:
DOCKER_IMAGE_DEV: villas/node-dev-ubuntu
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-ubuntu
CMAKE_OPTS: -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake -DCMAKE_PREFIX_PATH=/usr/local
build:centos:x86_64:
extends: build:fedora:x86_64
script:
- mkdir -p build && cd build
- cmake3 .. ${CMAKE_OPTS}
- make ${MAKE_OPTS}
variables:
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-centos
CMAKE_OPTS: -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake -DCMAKE_PREFIX_PATH=/usr/local
build:raspbian:armv6l:
extends: build:fedora:x86_64
variables:
DOCKER_IMAGE_DEV: villas/node-dev-raspbian
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-raspbian
CMAKE_OPTS: -DWITH_NODE_INFINIBAND=OFF
when: manual
build:debian-multiarch:armhf:
extends: build:fedora:x86_64
variables:
DOCKER_IMAGE_DEV: villas/node-dev-debian-armhf
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-debian-armhf
CMAKE_OPTS: -DCMAKE_TOOLCHAIN_FILE=/debian-armhf.cmake -DCMAKE_INSTALL_LIBDIR=/usr/lib/arm-linux-gnueabihf
build:debian-multiarch:arm64:
extends: build:fedora:x86_64
variables:
DOCKER_IMAGE_DEV: villas/node-dev-debian-arm64
DOCKER_IMAGE_DEV: registry.git.rwth-aachen.de/acs/public/villas/node/dev-debian-arm64
CMAKE_OPTS: -DCMAKE_TOOLCHAIN_FILE=/debian-arm64.cmake -DCMAKE_INSTALL_LIBDIR=/usr/lib/aarch64-linux-gnu
build:docs:
......@@ -177,8 +193,6 @@ packaging:docker:
--build-arg BUILDER_IMAGE=${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
--file packaging/docker/Dockerfile.app
--tag ${DOCKER_IMAGE}:${DOCKER_TAG} .
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
tags:
- shell
- linux
......@@ -239,3 +253,19 @@ deploy:packages:tags:
only:
# Only on version tags
- "/^v\\d+(\\.\\d+)+$/"
deploy:docker:
stage: deploy
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
- docker push registry.git.rwth-aachen.de/acs/public/villas/node/dev:${DOCKER_TAG}
- docker push registry.git.rwth-aachen.de/acs/public/villas/node/dev-ubuntu:${DOCKER_TAG}
- docker push registry.git.rwth-aachen.de/acs/public/villas/node/dev-centos:${DOCKER_TAG}
- docker push registry.git.rwth-aachen.de/acs/public/villas/node/dev-raspbian:${DOCKER_TAG}
- docker push registry.git.rwth-aachen.de/acs/public/villas/node/dev-debian-arm64:${DOCKER_TAG}
- docker push registry.git.rwth-aachen.de/acs/public/villas/node/dev-debian-armhf:${DOCKER_TAG}
tags:
- shell
- linux
......@@ -21,7 +21,7 @@
###################################################################################
set(DOCKER_FILE Dockerfile)
set(DOCKER_IMAGE villas/node)
set(DOCKER_IMAGE registry.git.rwth-aachen.de/acs/public/villas/node)
set(DOCKER_TAG ${CMAKE_PROJECT_GIT_BRANCH})
set(DOCKER_RUN_OPTS
--interactive
......@@ -38,29 +38,29 @@ set(DOCKER_RUN_OPTS
foreach(SUFFIX app dev dev-centos dev-ubuntu dev-raspbian)
add_custom_target(deploy-docker-${SUFFIX}
COMMAND docker push ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}
COMMAND docker push ${DOCKER_IMAGE}-${SUFFIX}:latest
COMMENT "Deploy Docker image: ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}"
COMMAND docker push ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}
COMMAND docker push ${DOCKER_IMAGE}/${SUFFIX}:latest
COMMENT "Deploy Docker image: ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}"
)
add_custom_target(run-docker-${SUFFIX}
COMMAND docker run ${DOCKER_RUN_OPTS} ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}
COMMENT "Run Docker image: ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}"
COMMAND docker run ${DOCKER_RUN_OPTS} ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}
COMMENT "Run Docker image: ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}"
)
add_custom_target(docker-${SUFFIX}
COMMAND docker build
--file ${CMAKE_CURRENT_SOURCE_DIR}/Dockerfile.${SUFFIX}
--tag ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}
--tag ${DOCKER_IMAGE}-${SUFFIX}:latest
--build-arg BUILDER_IMAGE=${DOCKER_IMAGE}-dev:${DOCKER_TAG}
--tag ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}
--tag ${DOCKER_IMAGE}/${SUFFIX}:latest
--build-arg BUILDER_IMAGE=${DOCKER_IMAGE}/dev:${DOCKER_TAG}
--build-arg DOCKER_TAG=${DOCKER_TAG}
--build-arg GIT_BRANCH=${CMAKE_PROJECT_GIT_BRANCH}
--build-arg GIT_REV=${CMAKE_PROJECT_GIT_REV}
--build-arg VERSION=${CMAKE_PROJECT_VERSION}
--build-arg VARIANT=${CMAKE_PROJECT_VARIANT}
${DOCKER_BUILD_OPTS} ${PROJECT_SOURCE_DIR}
COMMENT "Build Docker image: ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}"
COMMENT "Build Docker image: ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}"
)
add_dependencies(deploy-docker-${SUFFIX} docker-${SUFFIX})
......@@ -74,8 +74,8 @@ add_custom_target(run-docker
)
add_custom_target(docker
COMMAND docker tag ${DOCKER_IMAGE}-app:${DOCKER_TAG} ${DOCKER_IMAGE}:${DOCKER_TAG}
COMMAND docker tag ${DOCKER_IMAGE}-app:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
COMMAND docker tag ${DOCKER_IMAGE}/app:${DOCKER_TAG} ${DOCKER_IMAGE}:${DOCKER_TAG}
COMMAND docker tag ${DOCKER_IMAGE}/app:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
)
add_custom_target(deploy-docker DEPENDS docker-app
......
......@@ -38,7 +38,7 @@ ARG VERSION=unknown
ARG VARIANT=unknown
# Some of the dependencies are only available in our own repo
ADD https://villas.fein-aachen.org/packages/villas.repo /etc/yum.repos.d/
ADD https://packages.fein-aachen.org/redhat/fein.repo /etc/yum.repos.d/
USER root
......@@ -48,7 +48,7 @@ RUN yum -y install epel-release
# Toolchain
RUN yum -y install \
devtoolset-7-toolchain \
pkgconfig make cmake \
pkgconfig make cmake3 \
autoconf automake autogen libtool \
flex bison \
texinfo git curl tar \
......@@ -84,28 +84,48 @@ RUN yum -y install \
libwebsockets-devel \
zeromq-devel \
nanomsg \
libiec61850 \
librabbitmq-devel \
mosquitto-devel \
comedilib-devel \
libibverbs-devel \
librdmacm-devel \
re-devel \
uldaq-devel \
spdlog-devel
uldaq-devel
# Build & Install fmtlib
RUN cd /tmp && \
git clone --recursive https://github.com/fmtlib/fmt.git && \
mkdir -p fmt/build && cd fmt/build && \
git checkout 5.2.0 && \
cmake3 -DBUILD_SHARED_LIBS=1 .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Build & Install spdlog
RUN cd /tmp && \
git clone --recursive https://github.com/gabime/spdlog.git && \
mkdir -p spdlog/build && cd spdlog/build && \
git checkout v1.3.1 && \
cmake3 -DCMAKE_BUILD_TYPE=Release -DSPDLOG_FMT_EXTERNAL=1 -DSPDLOG_BUILD_BENCH=OFF .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Build & Install Criterion
RUN cd /tmp && \
git clone --recursive https://github.com/Snaipe/Criterion && \
mkdir -p Criterion/build && cd Criterion/build && \
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make install && \
cmake3 -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make install && \
rm -rf /tmp/*
# Build & Install Criterion
# Build & Install libwebsockets
RUN cd /tmp && \
git clone -b v2.4-stable http://github.com/warmcat/libwebsockets && \
git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \
mkdir -p libwebsockets/build && cd libwebsockets/build && \
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make install && \
cmake3 -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Build & Install libiec61850
RUN cd /tmp && \
git clone -b v1.3.1 https://github.com/mz-automation/libiec61850 && \
mkdir -p libiec61850/build && cd libiec61850/build && \
cmake3 -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Workaround for libnl3's search path for netem distributions
......
......@@ -106,7 +106,7 @@ RUN cd /tmp && \
RUN cd /tmp && \
git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \
mkdir -p libwebsockets/build && cd libwebsockets/build && \
cmake ${CMAKE_OPTS} -DLWS_INSTALL_LIB_DIR=/usr/lib/${TRIPLET} .. && make -j$(nproc) install && \
cmake ${CMAKE_OPTS} -DLWS_INSTALL_LIB_DIR=/usr/lib/${TRIPLET} -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Build & Install libiec61850
......
......@@ -81,7 +81,7 @@ RUN cd /tmp && \
RUN cd /tmp && \
git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \
mkdir -p libwebsockets/build && cd libwebsockets/build && \
cmake .. && make -j$(nproc) install && \
cmake -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Build & Install libiec61850
......
......@@ -107,7 +107,7 @@ RUN cd /tmp && \
RUN cd /tmp && \
git clone -b v3.1-stable https://github.com/warmcat/libwebsockets && \
mkdir -p libwebsockets/build && cd libwebsockets/build && \
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make -j$(nproc) install && \
cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 -DLWS_WITHOUT_TESTAPPS=ON .. && make -j$(nproc) install && \
rm -rf /tmp/*
# Build & Install libiec61850
......
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