aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-01-08 14:22:08 +0100
committerOliver Smith <osmith@sysmocom.de>2020-01-15 10:24:38 +0100
commitb79e06367bf72646c5114d60766ee61f1b9631bb (patch)
treed07a72c508dbe683faa766fcecb08e79214095b4
parentd0418d0f92b2cf73932c068f50bb55f90b78137b (diff)
docker: move to docker-playground.git
Instead of building "osmocom:deb9_amd64" from this repository, build "$USER/debian-stretch-jenkins" from docker-playground.git (same Dockerfile). Adjust all jobs to use the new image name. Add a new "update-osmo-ci-on-slaves-dp" jenkins job, which triggers the existing "update-osmo-ci-on-slaves" job whenever docker-playground.git changes. Replace docker/rebuild_osmocom_jenkins_image.sh with scripts/osmo-ci-docker-rebuild.sh, so we can get rid of the docker dir. I thought about dropping the script completely, and directly writing the two lines into contrib/jenkins.sh. But I kept the extra script for convenience, when testing locally. Related: OS#4345 Depends: docker-playground I125ae8a6bcabbd1f485028c79b0abacda0622c3a Change-Id: I30a61aebcadef5536e74edd35e1c75ef77a2da9f
-rwxr-xr-xcontrib/jenkins.sh3
-rw-r--r--docker/Dockerfile_osmocom_jenkins.amd64146
-rwxr-xr-xdocker/rebuild_osmocom_jenkins_image.sh22
-rw-r--r--jobs/gerrit-verifications.yml2
-rw-r--r--jobs/master-builds.yml2
-rw-r--r--jobs/osmo-gsm-tester-runner.yml3
-rw-r--r--jobs/update-osmo-ci-on-slaves.yml24
-rwxr-xr-xscripts/osmo-ci-docker-rebuild.sh5
8 files changed, 34 insertions, 173 deletions
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index b161230..275fc69 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -11,6 +11,5 @@ git rev-parse HEAD
git status
if [ `uname` = "Linux" ]; then
- cd docker
- ./rebuild_osmocom_jenkins_image.sh
+ scripts/osmo-ci-docker-rebuild.sh
fi
diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64
deleted file mode 100644
index 63b6e74..0000000
--- a/docker/Dockerfile_osmocom_jenkins.amd64
+++ /dev/null
@@ -1,146 +0,0 @@
-ARG DEBIAN_VERSION=stretch
-FROM debian:${DEBIAN_VERSION}
-
-# Make "$DEBIAN_VERSION" available after FROM
-# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
-ARG DEBIAN_VERSION
-
-# Install apt dependencies (keep in alphabetic order)
-RUN \
- dpkg --add-architecture i386 && \
- DEBIAN_FRONTEND=noninteractive apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
- asciidoc \
- asciidoc-dblatex \
- autoconf \
- autoconf-archive \
- automake \
- bc \
- bison \
- bzip2 \
- cmake \
- coccinelle \
- cppcheck \
- dahdi-source \
- dblatex \
- dbus \
- debhelper \
- devscripts \
- dh-autoreconf \
- dh-systemd \
- docbook5-xml \
- doxygen \
- flex \
- g++ \
- gawk \
- gcc \
- gcc-arm-none-eabi \
- git \
- git-buildpackage \
- graphviz \
- htop \
- inkscape \
- lcov \
- libaio-dev \
- libasound2-dev \
- libboost-all-dev \
- libc-ares-dev \
- libcsv-dev \
- libdbd-sqlite3 \
- libdbi-dev \
- libffi-dev \
- libfftw3-dev \
- libgmp-dev \
- libgnutls28-dev \
- libgps-dev \
- libgsm1-dev \
- liblua5.3-dev \
- libmnl-dev \
- libncurses5-dev \
- libnewlib-arm-none-eabi \
- liboping-dev \
- libortp-dev \
- libpcap-dev \
- libpcsclite-dev \
- libreadline-dev \
- libsctp-dev \
- libsigsegv-dev \
- libsnmp-dev \
- libsofia-sip-ua-glib-dev \
- libsqlite3-dev \
- libssl-dev \
- libtalloc-dev \
- libtool \
- libusb-1.0-0-dev \
- libusb-dev \
- libxml2-utils \
- libzmq3-dev \
- locales \
- lua-socket \
- make \
- mscgen \
- ofono \
- openssh-client \
- osc \
- patchelf \
- pkg-config \
- python3 \
- python3-gi \
- python3-mako \
- python3-nwdiag \
- python3-pip \
- python3-pyflakes \
- python3-setuptools \
- python3-usb \
- python3-yaml \
- rsync \
- sdcc \
- sqlite3 \
- stow \
- sudo \
- systemd \
- tcpdump \
- texinfo \
- unzip \
- wget \
- xsltproc
-
-# Install pip dependencies (keep in alphabetic order)
-RUN pip3 install \
- git+https://github.com/podshumok/python-smpplib.git \
- git+https://github.com/eriwen/lcov-to-cobertura-xml.git \
- pydbus \
- pysispm
-
-# match the outside user
-RUN useradd --uid=1000 build
-#RUN echo "build ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/build
-
-RUN mkdir /build
-RUN chown build:build /build
-
-# Install osmo-python-tests
-ADD http://git.osmocom.org/python/osmo-python-tests/patch /tmp/commit
-RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && ./contrib/jenkins.sh
-
-# Set a UTF-8 locale
-RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
- dpkg-reconfigure --frontend=noninteractive locales && \
- update-locale LANG=en_US.UTF-8
-ENV LANG en_US.UTF-8
-
-# osmo-remsim needs libulfius (which indirectly depends on systemd, installed above)
-ARG LIBULFIUS_VER="2.6.4"
-ARG LIBULFIUS_PATH="https://github.com/babelouest/ulfius/releases/download/v${LIBULFIUS_VER}"
-ADD ${LIBULFIUS_PATH}/libulfius-dev_${LIBULFIUS_VER}_debian_${DEBIAN_VERSION}_x86_64.deb /tmp/ulfius/libulfius-dev.deb
-ADD ${LIBULFIUS_PATH}/ulfius-dev-full_${LIBULFIUS_VER}_debian_${DEBIAN_VERSION}_x86_64.tar.gz /tmp/ulfius/all.tar.gz
-RUN cd /tmp/ulfius && \
- tar -xvf all.tar.gz && \
- DEBIAN_FRONTEND=noninteractive apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y /tmp/ulfius/*.deb && \
- cd ~ && \
- rm -r /tmp/ulfius
-
-# osmo-python-tests' contrib/jenkins.sh writes to /usr/local as user
-RUN chown -R build:build /usr/local
diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh
deleted file mode 100755
index 5d14d83..0000000
--- a/docker/rebuild_osmocom_jenkins_image.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash -e
-
-# Executes docker build with the given parameters and retry in case of error.
-function build_once() {
- # shellcheck disable=SC2068
- docker build $@ -f Dockerfile_osmocom_jenkins.amd64 .
-}
-
-# Builds a container with a debian version and tag name as parameter.
-function build_container() {
- local tag_name=${1}
- local debian_version=${2}
-
- echo "Pulling ${debian_version} image"
- docker pull "debian:${debian_version}"
-
- echo "Building for ${debian_version} and setting tag ${tag_name}"
- build_once "-t" "${tag_name}" "--build-arg" DEBIAN_VERSION="${debian_version}"
-}
-
-# Create containers using stretch (Debian 9.0) as base.
-build_container osmocom:deb9_amd64 stretch
diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index dfc9b88..0c338a6 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -40,7 +40,7 @@
-w /build -i -u build \
-v "$PWD:/build" -v "$HOME/bin:/build_bin" \
-v "$ARTIFACT_STORE:/artifact_store" \
- docker_img: 'osmocom:deb9_amd64'
+ docker_img: '$USER/debian-stretch-jenkins'
cmd: '{docker_run} {docker_img} /build/contrib/jenkins.sh'
gerrit_url: 'ssh://jenkins@gerrit.osmocom.org:29418'
repos_url: '{gerrit_url}/{repos}'
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 55626ea..78aeb7c 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -41,7 +41,7 @@
-v "$PWD:/build" -v "$HOME/bin:/build_bin" \
-v "$ARTIFACT_STORE:/artifact_store" \
-v "$HOME/.ssh:/home/build/.ssh:ro" \
- docker_img: 'osmocom:deb9_amd64'
+ docker_img: '$USER/debian-stretch-jenkins'
cmd: '{docker_run} {docker_img} /build/contrib/jenkins.sh'
wrappers: []
trigger:
diff --git a/jobs/osmo-gsm-tester-runner.yml b/jobs/osmo-gsm-tester-runner.yml
index c9d84a3..a4b64fd 100644
--- a/jobs/osmo-gsm-tester-runner.yml
+++ b/jobs/osmo-gsm-tester-runner.yml
@@ -241,7 +241,8 @@
-v "$HOME/bin:/build_bin" \
-v "$HOME/.ssh:/home/build/.ssh:ro" \
--cap-add=sys_nice \
- osmocom:deb9_amd64 /bin/bash -c 'LANG="en_US.utf8" LC_ALL="en_US.UTF-8" LC_LANG="en_US.UTF-8" PATH="$PWD/osmo-gsm-tester/src:${PATH}" ./osmo-gsm-tester/contrib/jenkins-run.sh'
+ $USER/debian-stretch-jenkins \
+ /bin/bash -c 'LANG="en_US.utf8" LC_ALL="en_US.UTF-8" LC_LANG="en_US.UTF-8" PATH="$PWD/osmo-gsm-tester/src:${PATH}" ./osmo-gsm-tester/contrib/jenkins-run.sh'
publishers:
- archive:
artifacts: '*-run.tgz, *-bin.tgz'
diff --git a/jobs/update-osmo-ci-on-slaves.yml b/jobs/update-osmo-ci-on-slaves.yml
index 2c7309e..d47f08e 100644
--- a/jobs/update-osmo-ci-on-slaves.yml
+++ b/jobs/update-osmo-ci-on-slaves.yml
@@ -39,4 +39,28 @@
- email:
recipients: intern@lists.sysmocom.de
+# Trigger from docker-playground.git too
+- job:
+ name: update-osmo-ci-on-slaves-dp
+ description: |
+ Trigger <a href="https://jenkins.osmocom.org/jenkins/job/update-osmo-ci-on-slaves/">update-osmo-ci-on-slaves</a>
+ on changes in docker-playground.git, so it can rebuild docker containers relevant for the jenkins slaves.
+ node: osmocom-master-debian9
+ scm:
+ - git:
+ url: git://git.osmocom.org/docker-playground
+ git-config-name: 'Jenkins Builder'
+ git-config-email: 'jenkins@osmocom.org'
+ skip-tag: true
+ branches:
+ - 'origin/master'
+ triggers:
+ - pollscm:
+ cron: "H/5 * * * *"
+ ignore-post-commit-hooks: false
+ publishers:
+ - trigger:
+ project: "update-osmo-ci-on-slaves"
+
+
# vim: expandtab tabstop=2 shiftwidth=2
diff --git a/scripts/osmo-ci-docker-rebuild.sh b/scripts/osmo-ci-docker-rebuild.sh
new file mode 100755
index 0000000..4a7ee25
--- /dev/null
+++ b/scripts/osmo-ci-docker-rebuild.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+cd "$(dirname "$0")/.."
+. scripts/common.sh
+docker_images_require \
+ "debian-stretch-jenkins"