blob: bb005eb350d8d368b78218c44ab071296841403f [file] [log] [blame]
garciadeblas7b53d262022-11-04 23:18:48 +01001#######################################################################################
2# Copyright ETSI Contributors and Others.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#######################################################################################
17
garciadeblas0b7ef272023-05-10 10:50:34 +020018FROM apache/airflow:2.5.3-python3.10
garciadeblas7b53d262022-11-04 23:18:48 +010019USER root
20RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
21 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
22 gcc git python3 python3-dev python3-venv python3-pip \
garciadeblas1233df72023-05-10 17:02:39 +020023 python3-setuptools wget zstd && \
garciadeblas7b53d262022-11-04 23:18:48 +010024 python3 -m pip install -U pip build
25
garciadeblas9f586332022-11-28 23:54:26 +010026USER airflow
27
garciadeblas2fc3deb2025-11-25 17:26:14 +010028# Install base requirements
29RUN pip install --no-cache-dir setuptools-scm wheel
30
31# Install OSM common from Git
32ARG COMMON_GERRIT_REFSPEC=master
33RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \
34 cd /tmp/osm-common && \
35 git fetch origin ${COMMON_GERRIT_REFSPEC} && \
36 git checkout FETCH_HEAD && \
37 cd - && \
38 pip3 wheel --no-cache-dir -r /tmp/osm-common/requirements.txt -w /tmp/wheels && \
39 pip3 wheel --no-cache-dir /tmp/osm-common -w /tmp/wheels
40RUN pip install --no-cache-dir --no-index --find-links=/tmp/wheels \
41 -r /tmp/osm-common/requirements.txt \
42 osm_common && \
43 rm -rf /tmp/wheels
44
garciadeblas7b53d262022-11-04 23:18:48 +010045ARG PYTHON3_OSM_NGSA_URL
garciadeblas0cdfb572022-11-11 10:24:51 +010046RUN curl $PYTHON3_OSM_NGSA_URL -o osm_ngsa.deb
garciadeblas9f586332022-11-28 23:54:26 +010047
garciadeblas1233df72023-05-10 17:02:39 +020048RUN ar x osm_ngsa.deb && \
49 zstd -d < control.tar.zst | xz > control.tar.xz && \
50 zstd -d < data.tar.zst | xz > data.tar.xz && \
51 ar -m -c -a sdsd osm_ngsa_repacked.deb debian-binary control.tar.xz data.tar.xz && \
52 rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
53
54RUN mkdir /tmp/osm
garciadeblas1233df72023-05-10 17:02:39 +020055RUN dpkg-deb -x osm_ngsa_repacked.deb /tmp/osm
garciadeblas75e3d992023-03-23 17:31:44 +010056RUN mv /tmp/osm/usr/lib/python3/dist-packages/* /home/airflow/.local/lib/python3.10/site-packages/
garciadeblas9f586332022-11-28 23:54:26 +010057RUN rm -rf /tmp/osm
garciadeblas7b53d262022-11-04 23:18:48 +010058
59RUN pip3 install \
garciadeblas1233df72023-05-10 17:02:39 +020060 -r /home/airflow/.local/lib/python3.10/site-packages/osm_ngsa/requirements.txt
garciadeblas7b53d262022-11-04 23:18:48 +010061