Update Airflow/Dockerfile to install osm_ngsa deb package in user folder 45/12745/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 28 Nov 2022 22:54:26 +0000 (23:54 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 29 Nov 2022 08:13:36 +0000 (09:13 +0100)
Change-Id: Iacc57c09341252ca7d7a11f89a2ba7a3ba697cf9
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
docker/Airflow/Dockerfile
installers/helm/values/airflow-values.yaml

index 73591cd..2727977 100644 (file)
@@ -23,15 +23,24 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     python3-setuptools wget && \
     python3 -m pip install -U pip build
 
+USER airflow
+
 ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_NGSA_URL
 RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
-RUN dpkg -i ./osm_common.deb
 RUN curl $PYTHON3_OSM_NGSA_URL -o osm_ngsa.deb
-RUN dpkg -i ./osm_ngsa.deb
+RUN mkdir /tmp/osm
+RUN dpkg-deb -x osm_common.deb /tmp/osm
+RUN dpkg-deb -x osm_ngsa.deb /tmp/osm
+
+RUN mv /tmp/osm/usr/lib/python3/dist-packages/* /home/airflow/.local/lib/python3.8/site-packages/
+RUN rm -rf /tmp/osm
 
 RUN pip3 install \
-    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
-    -r /usr/lib/python3/dist-packages/osm_ngsa/requirements.txt
+    -r /home/airflow/.local/lib/python3.8/site-packages/osm_common/requirements.txt \
+    -r /home/airflow/.local/lib/python3.8/site-packages/osm_ngsa/requirements.txt
+
+RUN pip3 install \
+    -r /home/airflow/.local/lib/python3.8/site-packages/osm_common/requirements.txt \
+    -r /home/airflow/.local/lib/python3.8/site-packages/osm_ngsa/requirements.txt
 
-USER airflow
index fd7eb63..0a62abf 100644 (file)
@@ -30,5 +30,5 @@ extraEnvFrom: |
       name: ngsa-secret
 config:
   core:
-    dags_folder: "/usr/lib/python3/dist-packages/osm_ngsa"
+    dags_folder: "/home/airflow/.local/lib/python3.8/site-packages/osm_ngsa"