Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
######################################################################
# Node stage to deal with static asset construction
######################################################################
ARG PY_VER=3.11.14-slim-trixie
ARG PY_VER=3.11.17-slim-trixie

# If BUILDPLATFORM is null, set it to 'amd64' (or leave as is otherwise).
ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64}
Expand Down Expand Up @@ -306,20 +306,45 @@ CMD ["/app/docker/entrypoints/docker-ci.sh"]
FROM lean AS stacklet
USER root

ARG SUPERSET_VERSION=""
ARG SUPERSET_GIT_SHA=""

COPY requirements/stacklet.txt requirements/

RUN --mount=type=cache,target=${SUPERSET_HOME}/.cache/uv \
/app/docker/pip-install.sh -r requirements/stacklet.txt
# Screenshots launch Chromium headless, which only needs the headless shell.
RUN . /app/.venv/bin/activate && \
playwright install-deps && \
playwright install chromium
playwright install-deps chromium && \
playwright install --only-shell chromium

# Declared here so a new version or SHA only invalidates the layers below.
ARG SUPERSET_VERSION=""
ARG SUPERSET_GIT_SHA=""

RUN if [ -n "${SUPERSET_VERSION}" ]; then \
printf '{"version":"%s","GIT_SHA":"%s"}' \
"${SUPERSET_VERSION}" "${SUPERSET_GIT_SHA}" \
> superset/static/version_info.json; \
fi

# Remove build-only packages. The venv's native extensions link only libc,
# libgcc, libstdc++ and zlib (psycopg2-binary bundles its client libraries),
# and the system Python's uv, wheel and setuptools are only used at build time.
# apt-get upgrade picks up Debian updates newer than the base image. This layer
# follows the SUPERSET_* ARGs, so it reruns on every build.
Comment on lines +328 to +332

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth trying to have a build-only layer later?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good idea - will file a ticket to track. Thanks

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get remove -y --purge \
libc6-dev \
libcrypt-dev \
libecpg-dev \
libldap-dev \
libldap2-dev \
libpq-dev \
libsasl2-dev \
libssl-dev \
linux-libc-dev && \
apt-get upgrade -y && \
apt-get autoremove -y --purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
/usr/local/bin/python -m pip uninstall -y uv wheel setuptools
USER superset
2 changes: 1 addition & 1 deletion requirements/stacklet.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Compiled via ./scripts/uv-pip-compile.sh
-e .[postgres,fastmcp]
boto3>=1.0.0,<2
playwright>=1.61.0,<2
playwright>=1.64.1,<2
sentry-sdk[flask,celery,sqlalchemy]>=2.0.0,<3
2 changes: 1 addition & 1 deletion requirements/stacklet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ platformdirs==4.3.8
# -c requirements/base-constraint.txt
# fastmcp-slim
# requests-cache
playwright==1.61.0
playwright==1.64.1
# via -r requirements/stacklet.in
ply==3.11
# via
Expand Down
Loading