Skip to content

Commit aa10479

Browse files
committed
chore(superset): Use uv to install dependencies
1 parent 4467aa5 commit aa10479

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

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

superset/versions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"statsd_exporter": "0.28.0",
88
"authlib": "1.2.1", # https://github.com/dpgaspar/Flask-AppBuilder/blob/release/4.4.1/requirements/extra.txt#L7
99
"stackable-base": "1.0.0",
10+
"uv": "0.7.3",
1011
},
1112
{
1213
"product": "4.1.1",
@@ -16,6 +17,7 @@
1617
"statsd_exporter": "0.28.0",
1718
"authlib": "1.2.1", # https://github.com/dpgaspar/Flask-AppBuilder/blob/release/4.5.0/requirements/extra.txt#L7
1819
"stackable-base": "1.0.0",
20+
"uv": "0.7.3",
1921
},
2022
{
2123
"product": "4.1.2",
@@ -25,5 +27,6 @@
2527
"statsd_exporter": "0.28.0",
2628
"authlib": "1.2.1", # https://github.com/dpgaspar/Flask-AppBuilder/blob/release/4.5.0/requirements/extra.txt#L7
2729
"stackable-base": "1.0.0",
30+
"uv": "0.7.3",
2831
},
2932
]

0 commit comments

Comments
 (0)