Update Dockerfiles to install osm-common from git repo 44/15544/3
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 25 Nov 2025 16:26:14 +0000 (17:26 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 26 Nov 2025 15:14:13 +0000 (16:14 +0100)
Change-Id: I013357affd57cf8b56fea8e9746c332524db0428
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
docker/Airflow/Dockerfile
docker/LCM/Dockerfile
docker/MON/Dockerfile
docker/NBI/Dockerfile
docker/RO/Dockerfile

index 1a4184c..bb005eb 100644 (file)
@@ -25,16 +25,26 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
 
 USER airflow
 
-ARG PYTHON3_OSM_COMMON_URL
+# Install base requirements
+RUN pip install --no-cache-dir setuptools-scm wheel
+
+# Install OSM common from Git
+ARG COMMON_GERRIT_REFSPEC=master
+RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \
+  cd /tmp/osm-common && \
+  git fetch origin ${COMMON_GERRIT_REFSPEC} && \
+  git checkout FETCH_HEAD && \
+  cd - && \
+  pip3 wheel --no-cache-dir -r /tmp/osm-common/requirements.txt -w /tmp/wheels && \
+  pip3 wheel --no-cache-dir /tmp/osm-common -w /tmp/wheels
+RUN pip install --no-cache-dir --no-index --find-links=/tmp/wheels \
+    -r /tmp/osm-common/requirements.txt \
+    osm_common && \
+    rm -rf /tmp/wheels
+
 ARG PYTHON3_OSM_NGSA_URL
-RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
 RUN curl $PYTHON3_OSM_NGSA_URL -o osm_ngsa.deb
 
-RUN ar x osm_common.deb && \
-    zstd -d < control.tar.zst | xz > control.tar.xz && \
-    zstd -d < data.tar.zst | xz > data.tar.xz && \
-    ar -m -c -a sdsd osm_common_repacked.deb debian-binary control.tar.xz data.tar.xz && \
-    rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
 RUN ar x osm_ngsa.deb && \
    zstd -d < control.tar.zst | xz > control.tar.xz && \
    zstd -d < data.tar.zst | xz > data.tar.xz && \
@@ -42,12 +52,10 @@ RUN ar x osm_ngsa.deb && \
    rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
 
 RUN mkdir /tmp/osm
-RUN dpkg-deb -x osm_common_repacked.deb /tmp/osm
 RUN dpkg-deb -x osm_ngsa_repacked.deb /tmp/osm
 RUN mv /tmp/osm/usr/lib/python3/dist-packages/* /home/airflow/.local/lib/python3.10/site-packages/
 RUN rm -rf /tmp/osm
 
 RUN pip3 install \
-   -r /home/airflow/.local/lib/python3.10/site-packages/osm_common/requirements.txt \
    -r /home/airflow/.local/lib/python3.10/site-packages/osm_ngsa/requirements.txt
 
index 97ebd09..0e025f7 100644 (file)
@@ -39,6 +39,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     apt-transport-https=2.4.* \
     gnupg2=2.2.* \
     openssh-client=1:8.* \
+    git \
     && rm -rf /var/lib/apt/lists/*
 
 # https://kubernetes.io/releases/
@@ -52,17 +53,20 @@ RUN curl https://get.helm.sh/helm-v3.15.1-linux-amd64.tar.gz --output helm-v3.15
     && mv linux-amd64/helm /usr/local/bin/helm3 \
     && rm -r linux-amd64/
 
-ARG PYTHON3_OSM_COMMON_URL
-ARG PYTHON3_OSM_LCM_URL
-
-RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
-RUN dpkg -i ./osm_common.deb
+ARG COMMON_GERRIT_REFSPEC=master
+RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \
+    cd /tmp/osm-common && \
+    git fetch origin ${COMMON_GERRIT_REFSPEC} && \
+    git checkout FETCH_HEAD && \
+    cd - && \
+    pip install --no-cache-dir -r /tmp/osm-common/requirements.txt && \
+    pip install /tmp/osm-common
 
+ARG PYTHON3_OSM_LCM_URL
 RUN curl $PYTHON3_OSM_LCM_URL -o osm_lcm.deb
 RUN dpkg -i ./osm_lcm.deb
 
 RUN pip3 install \
-    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_lcm/requirements.txt
 
 #######################################################################################
index 55255ec..ba283c3 100644 (file)
@@ -37,19 +37,22 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    openssh-client=1:8.*
+    openssh-client=1:8.* git
 
-ARG PYTHON3_OSM_COMMON_URL
-ARG PYTHON3_OSM_MON_URL
-
-RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
-RUN dpkg -i ./osm_common.deb
+ARG COMMON_GERRIT_REFSPEC=master
+RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \
+    cd /tmp/osm-common && \
+    git fetch origin ${COMMON_GERRIT_REFSPEC} && \
+    git checkout FETCH_HEAD && \
+    cd - && \
+    pip install --no-cache-dir -r /tmp/osm-common/requirements.txt && \
+    pip install /tmp/osm-common
 
+ARG PYTHON3_OSM_MON_URL
 RUN curl $PYTHON3_OSM_MON_URL -o osm_mon.deb
 RUN dpkg -i ./osm_mon.deb
 
 RUN pip3 install \
-    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_mon/requirements.txt
 
 #######################################################################################
index 664cc63..f7d823d 100644 (file)
@@ -35,13 +35,23 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
 #######################################################################################
 # End of common preparation
 
-ARG PYTHON3_OSM_COMMON_URL
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    git \
+    && rm -rf /var/lib/apt/lists/*
+
+ARG COMMON_GERRIT_REFSPEC=master
+RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \
+    cd /tmp/osm-common && \
+    git fetch origin ${COMMON_GERRIT_REFSPEC} && \
+    git checkout FETCH_HEAD && \
+    cd - && \
+    pip install --no-cache-dir -r /tmp/osm-common/requirements.txt && \
+    pip install /tmp/osm-common
+
 ARG PYTHON3_OSM_IM_URL
 ARG PYTHON3_OSM_NBI_URL
 
-RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
-RUN dpkg -i ./osm_common.deb
-
 RUN curl $PYTHON3_OSM_IM_URL -o osm_im.deb
 RUN dpkg -i ./osm_im.deb
 
@@ -49,7 +59,6 @@ RUN curl $PYTHON3_OSM_NBI_URL -o osm_nbi.deb
 RUN dpkg -i ./osm_nbi.deb
 
 RUN pip3 install \
-    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_nbi/requirements.txt
 
index 0d84dac..69d40b4 100644 (file)
@@ -39,9 +39,18 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
     genisoimage=9:1.1.* \
     libmagic1 \
-    netbase=6.*
+    netbase=6.* \
+    git
+
+ARG COMMON_GERRIT_REFSPEC=master
+RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \
+    cd /tmp/osm-common && \
+    git fetch origin ${COMMON_GERRIT_REFSPEC} && \
+    git checkout FETCH_HEAD && \
+    cd - && \
+    pip install --no-cache-dir -r /tmp/osm-common/requirements.txt && \
+    pip install /tmp/osm-common
 
-ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_NG_RO_URL
 ARG PYTHON3_OSM_RO_PLUGIN_URL
 ARG PYTHON3_OSM_ROSDN_ARISTA_CLOUDVISION_URL
@@ -62,7 +71,6 @@ ARG PYTHON3_OSM_ROVIM_VCENTER_URL
 ARG PYTHON3_OSM_ROVIM_VMWARE_URL
 
 RUN for URL in \
-    $PYTHON3_OSM_COMMON_URL \
     $PYTHON3_OSM_NG_RO_URL \
     $PYTHON3_OSM_RO_PLUGIN_URL \
     $PYTHON3_OSM_ROSDN_ARISTA_CLOUDVISION_URL \
@@ -87,7 +95,6 @@ RUN for URL in \
 RUN dpkg -i *.deb
 
 RUN pip3 install \
-    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_ng_ro/requirements.txt
 
 #######################################################################################