osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/38440?usp=email )

Change subject: osmo-gsm-tester: use debian-bookworm-build
......................................................................

osmo-gsm-tester: use debian-bookworm-build

osmo-gsm-tester was the last user of debian-buster-jenkins, and it just
broke again for some reason. Instead of adjusting debian-buster-jenkins
again this time, I've adjusted osmo-gsm-tester to run with
debian-bookworm-build instead so we can avoid the maintenance effort of
keeping debian-buster-jenkins working, as well as the additional time
needed to build this container.

We held off from upgrading to debian-bookworm-build, because no mongodb
debian packages are available for bookworm. However in the meantime we
have just installed the bullseye mongodb package in bookworm together
with the older libssl from bullseye that it was build against - we did
this in other containers already, so do this here too.

Other adjustments:
* Pip needs --break-system-packages now (it is fine in a docker
  container)
* Patchelf in bookworm is >= 0.11 (getting installed in the apt install
  call already), so we don't need to build it from source anymore.
* Remove 'if [ "$(arch)" = "x86_64" ];' around the mongodb code. This
  was needed earlier when we used to build this container on arm devices
  too, but AFAIK we don't do that anymore and it wasn't really useful in
  the first place. (And if we do we can bring this back easily.)
* Add rpm2cpio and cpio, because these are used during the
  osmo-gsm-tester_build-osmocom-bb job which will use this docker image
  with an upcoming osmo-ci patch (currently it is not using docker to
  build the Osmocom programs, but that leads to missing library errors
  once we upgrade to bookworm here). IMHO the build process should be
  reworked so that this is not necessary, but given that osmo-gsm-tester
  isn't really maintained currently, this is the bare minimum needed to
  migrate it away from debian buster.

Related: OS#6126
Change-Id: I5ed3b92f07f23c96b8f953e0a93991cc89476a12
---
M osmo-gsm-tester/Dockerfile
1 file changed, 21 insertions(+), 30 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve




diff --git a/osmo-gsm-tester/Dockerfile b/osmo-gsm-tester/Dockerfile
index 0105e47..b38706d 100644
--- a/osmo-gsm-tester/Dockerfile
+++ b/osmo-gsm-tester/Dockerfile
@@ -1,8 +1,7 @@
 ARG    USER
-FROM   $USER/debian-buster-jenkins
+FROM   $USER/debian-bookworm-build
 ARG    OGT_MASTER_ADDR="172.18.50.2"

-
 # Create jenkins user
 RUN     useradd -ms /bin/bash jenkins
 # Create osmo-gsm-tester group and add user to it
@@ -12,6 +11,7 @@
 # install osmo-gsm-tester dependencies
 RUN    apt-get update && \
        apt-get install -y --no-install-recommends \
+               cpio \
                dbus \
                tcpdump \
                sqlite3 \
@@ -25,6 +25,7 @@
                python3-watchdog \
                ofono \
                patchelf \
+               rpm2cpio \
                sudo \
                libcap2-bin \
                python3-pip \
@@ -33,7 +34,7 @@
                locales

 # install osmo-gsm-tester pip dependencies
-RUN    pip3 install \
+RUN    pip3 install --break-system-packages \
                
"git+https://github.com/podshumok/python-smpplib.git@master#egg=smpplib"; \
                pydbus \
                pyusb \
@@ -63,16 +64,6 @@
     update-locale LANG=en_US.UTF-8
 ENV LANG en_US.UTF-8

-# We require a newer patchelf 0.11 (OS#4389)
-ADD     https://github.com/NixOS/patchelf/archive/0.11.tar.gz 
/tmp/patchelf-0.11.tar.gz
-RUN     cd /tmp && \
-        tar -zxf /tmp/patchelf-0.11.tar.gz && \
-        cd patchelf-0.11 && \
-       autoreconf -fi && \
-        ./configure --prefix=/usr/local && \
-        make && \
-        make install
-
 RUN    apt-get update && \
        apt-get install -y --no-install-recommends \
                telnet \
@@ -109,23 +100,23 @@
                gnuradio && \
        apt-get clean

-# install open5gs dependencies: (mongodb not available in Debian)
-# systemctl stuff: workaround for https://jira.mongodb.org/browse/SERVER-54386
-ADD    https://www.mongodb.org/static/pgp/server-4.4.asc 
/tmp/mongodb-server-4.4.asc
-RUN    if [ "$(arch)" = "x86_64" ]; then \
-               apt-key add /tmp/mongodb-server-4.4.asc && \
-               echo "deb http://repo.mongodb.org/apt/debian 
buster/mongodb-org/4.4 main" \
-                       > /etc/apt/sources.list.d/mongodb-org-4.4.list; \
-       fi
-RUN    if [ "$(arch)" = "x86_64" ]; then \
-               apt-get update && \
-               systemctl_path=$(which systemctl) && \
-               mv $systemctl_path /tmp/systemctl && \
-               apt-get install -y --no-install-recommends mongodb-org && \
-               apt-get clean && \
-               mv /tmp/systemctl $systemctl_path && \
-               sed -i "s/127.0.0.1/$OGT_MASTER_ADDR/g" /etc/mongod.conf; \
-       fi
+# Add mongodb using the package from bullseye since a bookworm mongodb-org
+# package is not available. Furthermore, manually install required libssl1.1.
+RUN    set -x && \
+       mkdir -p /tmp/mongodb && \
+       cd /tmp/mongodb && \
+       wget "https://pgp.mongodb.com/server-5.0.asc"; -O "/mongodb.key" && \
+       wget 
"http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_amd64.deb";
 && \
+       dpkg -i "libssl1.1_1.1.1n-0+deb10u6_amd64.deb" && \
+       echo "deb [signed-by=/mongodb.key] http://repo.mongodb.org/apt/debian 
bullseye/mongodb-org/5.0 main" \
+               > /etc/apt/sources.list.d/mongodb-org.list && \
+       apt-get update && \
+       apt-get install -y mongodb-org && \
+       apt-get clean && \
+       cd / && \
+       rm -rf /tmp/mongodb && \
+       rm /etc/apt/sources.list.d/mongodb-org.list && \
+       sed -i "s/127.0.0.1/$OGT_MASTER_ADDR/g" /etc/mongod.conf

 # install open5gs dependencies:
 RUN    if [ "$(arch)" = "x86_64" ]; then \

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/38440?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I5ed3b92f07f23c96b8f953e0a93991cc89476a12
Gerrit-Change-Number: 38440
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to