Skip to content

Commit 0ff2d35

Browse files
committed
chore: Use uv to install dependencies
1 parent 5b64615 commit 0ff2d35

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

airflow/Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ ARG TARGETARCH
3131
ARG STACKABLE_USER_UID
3232
ARG S3FS
3333
ARG CYCLONEDX_BOM
34-
35-
COPY airflow/constraints-${PRODUCT}-python${PYTHON}.txt /tmp/constraints.txt
36-
COPY --from=opa-auth-manager-builder /tmp/opa-auth-manager/dist/opa_auth_manager-0.1.0-py3-none-any.whl /tmp/
34+
ARG UV
3735

3836
# The mysql provider is currently excluded.
3937
# Requires implementation of https://github.com/apache/airflow/blob/2.2.5/scripts/docker/install_mysql.sh
@@ -62,19 +60,27 @@ RUN microdnf update && \
6260
microdnf clean all && \
6361
rm -rf /var/cache/yum
6462

63+
COPY airflow/stackable/constraints/${PRODUCT}/constraints-python${PYTHON}.txt /tmp/constraints.txt
64+
COPY airflow/stackable/constraints/${PRODUCT}/build-constraints-python${PYTHON}.txt /tmp/build-constraints.txt
65+
COPY --from=opa-auth-manager-builder /tmp/opa-auth-manager/dist/opa_auth_manager-0.1.0-py3-none-any.whl /tmp/
66+
6567
RUN <<EOF
6668
python${PYTHON} -m venv --system-site-packages /stackable/app
6769

6870
source /stackable/app/bin/activate
6971

72+
# Upgrade pip to the latest version
73+
# Also install uv to get support for build constraints
7074
pip install --no-cache-dir --upgrade pip
71-
pip install --no-cache-dir apache-airflow[${AIRFLOW_EXTRAS}]==${PRODUCT} --constraint /tmp/constraints.txt
75+
pip install --no-cache-dir uv==${UV}
76+
77+
uv pip install --no-cache-dir apache-airflow[${AIRFLOW_EXTRAS}]==${PRODUCT} --constraint /tmp/constraints.txt --build-constraints /tmp/build-constraints.txt
7278
# Needed for pandas S3 integration to e.g. write and read csv and parquet files to/from S3
73-
pip install --no-cache-dir s3fs==${S3FS} cyclonedx-bom==${CYCLONEDX_BOM}
79+
uv pip install --no-cache-dir s3fs==${S3FS} cyclonedx-bom==${CYCLONEDX_BOM}
7480
# Needed for OIDC
75-
pip install --no-cache-dir Flask_OIDC==2.2.0 Flask-OpenID==1.3.1
81+
uv pip install --no-cache-dir Flask_OIDC==2.2.0 Flask-OpenID==1.3.1
7682

77-
pip install --no-cache-dir /tmp/opa_auth_manager-0.1.0-py3-none-any.whl
83+
uv pip install --no-cache-dir /tmp/opa_auth_manager-0.1.0-py3-none-any.whl
7884

7985
# Create the SBOM for Airflow
8086
# Important: All `pip install` commands must be above this line, otherwise the SBOM will be incomplete

airflow/versions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"statsd_exporter": "0.28.0",
99
"tini": "0.19.0",
1010
"vector": "0.46.1",
11+
"uv": "0.7.3",
1112
},
1213
{
1314
"product": "2.10.4",
@@ -18,6 +19,7 @@
1819
"statsd_exporter": "0.28.0",
1920
"tini": "0.19.0",
2021
"vector": "0.46.1",
22+
"uv": "0.7.3",
2123
},
2224
{
2325
"product": "2.10.5",
@@ -28,5 +30,6 @@
2830
"statsd_exporter": "0.28.0",
2931
"tini": "0.19.0",
3032
"vector": "0.46.1",
33+
"uv": "0.7.3",
3134
},
3235
]

0 commit comments

Comments
 (0)