Skip to content

Commit 53e93ce

Browse files
TechassinightkrMaleware
authored
fix(airflow/superset): Pin Cython version (#1116)
* chore(airflow): Move runtime constraint files Co-authored-by: Natalie Klestrup Röijezon <[email protected]> Co-authored-by: Maxi Wittich <[email protected]> * chore(airflow): Add build constraint files * chore(airflow): Use uv to install dependencies * chore(superset): Move runtime constraint files * chore(superset): Add build constraints files * chore(superset): Use uv to install dependencies * chore: Update changelog --------- Co-authored-by: Natalie Klestrup Röijezon <[email protected]> Co-authored-by: Maxi Wittich <[email protected]>
1 parent d803a8e commit 53e93ce

17 files changed

+43
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ All notable changes to this project will be documented in this file.
4040

4141
### Changed
4242

43+
- airflow,superset: Use `uv` to build the product ([#1116]).
4344
- ubi-rust-builder: Bump Rust toolchain to 1.85.0, cargo-cyclonedx to 0.5.7, and cargo-auditable to 0.6.6 ([#1050]).
4445
- ubi9-rust-builder: Bump base image and update protoc to `30.2` ([#1091]).
4546
- stackable-devel: Bump ubi9 base image ([#1103]).
@@ -53,6 +54,7 @@ All notable changes to this project will be documented in this file.
5354

5455
### Fixed
5556

57+
- airflow: Pin Cython version ([#1116]).
5658
- druid: reduce docker image size by removing the recursive chown/chmods in the final image ([#1039]).
5759
- hadoop: reduce docker image size by removing the recursive chown/chmods in the final image ([#1029]).
5860
- hbase: reduce docker image size by removing the recursive chown/chmods in the final image ([#1028]).
@@ -63,6 +65,7 @@ All notable changes to this project will be documented in this file.
6365
- opa: reduce docker image size by removing the recursive chown/chmods in the final image ([#1038]).
6466
- opa: Manually install Go 1.23.9 ([#1103]).
6567
- spark-k8s: reduce docker image size by removing the recursive chown/chmods in the final image ([#1042]).
68+
- superset: Pin Cython version ([#1116]).
6669
- trino: reduce docker image size by removing the recursive chown/chmods in the final image ([#1025]).
6770
- zookeeper: reduce docker image size by removing the recursive chown/chmods in the final image ([#1043]).
6871
- Fixed two hardcoded username references ([#1052]).
@@ -104,6 +107,7 @@ All notable changes to this project will be documented in this file.
104107
[#1103]: https://github.com/stackabletech/docker-images/pull/1103
105108
[#1106]: https://github.com/stackabletech/docker-images/pull/1106
106109
[#1108]: https://github.com/stackabletech/docker-images/pull/1108
110+
[#1116]: https://github.com/stackabletech/docker-images/pull/1116
107111

108112
## [25.3.0] - 2025-03-21
109113

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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cython==3.1.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cython==3.1.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cython==3.0.12

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
]

superset/Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ ARG AUTHLIB
4141
ARG TARGETARCH
4242
ARG TARGETOS
4343
ARG CYCLONEDX_BOM
44-
45-
COPY superset/constraints-${PRODUCT}.txt /tmp/constraints.txt
46-
COPY --from=opa-authorizer-builder /tmp/opa-authorizer/dist/opa_authorizer-0.1.0-py3-none-any.whl /tmp/
44+
ARG UV
4745

4846
RUN microdnf update \
4947
&& microdnf install \
@@ -68,6 +66,12 @@ RUN microdnf update \
6866
&& microdnf clean all && \
6967
rm -rf /var/cache/yum
7068

69+
COPY superset/stackable/constraints/${PRODUCT}/constraints.txt /tmp/constraints.txt
70+
COPY superset/stackable/constraints/${PRODUCT}/build-constraints.txt /tmp/build-constraints.txt
71+
COPY --from=opa-authorizer-builder /tmp/opa-authorizer/dist/opa_authorizer-0.1.0-py3-none-any.whl /tmp/
72+
73+
# Upgrade pip to the latest version
74+
# Also install uv to get support for build constraints
7175
# DL3042 false-positive, --no-chache-dir is specified a few lines below.
7276
# See https://github.com/hadolint/hadolint/issues/1042.
7377
# hadolint ignore=DL3042
@@ -78,10 +82,12 @@ RUN python3 -m venv /stackable/app \
7882
--upgrade \
7983
setuptools==75.2.0 \
8084
pip \
81-
&& pip install \
85+
uv==${UV} \
86+
&& uv pip install \
8287
--no-cache-dir \
8388
--upgrade \
84-
--constraint /tmp/constraints.txt \
89+
--constraints /tmp/constraints.txt \
90+
--build-constraints /tmp/build-constraints.txt \
8591
apache-superset==${PRODUCT} \
8692
gevent \
8793
psycopg2-binary \
@@ -104,15 +110,15 @@ RUN python3 -m venv /stackable/app \
104110
# We only want to bump this for the 4.0.x line, as the others already have updated and we don't want to accidentially downgrade the version
105111
&& if [[ "$PRODUCT" =~ ^4\.0\..* ]]; \
106112
then echo "Superset 4.0.x detected, installing gunicorn 22.0.0 to fix CVE-2024-1135" \
107-
&& pip install gunicorn==22.0.0; \
113+
&& uv pip install gunicorn==22.0.0; \
108114
fi \
109-
&& pip install \
115+
&& uv pip install \
110116
--no-cache-dir \
111117
--upgrade \
112118
python-json-logger \
113119
cyclonedx-bom==${CYCLONEDX_BOM} \
114120
&& if [ -n "$AUTHLIB" ]; then pip install Authlib==${AUTHLIB}; fi && \
115-
pip install --no-cache-dir /tmp/opa_authorizer-0.1.0-py3-none-any.whl
121+
uv pip install --no-cache-dir /tmp/opa_authorizer-0.1.0-py3-none-any.whl
116122

117123
COPY --from=statsd_exporter-builder /statsd_exporter/statsd_exporter /stackable/statsd_exporter
118124

0 commit comments

Comments
 (0)