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
This commit is contained in:
Oliver Smith 2020-01-08 14:22:08 +01:00
parent d0418d0f92
commit b79e06367b
8 changed files with 34 additions and 173 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}'

View File

@ -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:

View File

@ -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'

View File

@ -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

View File

@ -0,0 +1,5 @@
#!/bin/sh
cd "$(dirname "$0")/.."
. scripts/common.sh
docker_images_require \
"debian-stretch-jenkins"