Skip to content

Commit

Permalink
feat: bake transactions into Docker images
Browse files Browse the repository at this point in the history
There's been some confusion around the state of the translations in the repo as well as within different builds (docker, pypi, official releases,...).

In this PR, we assume that "compiled" or redundant files that can be generated don't belong in the repository, and should be baked as part of the build process.

Yet to TO DO to get this out of DRAFT:
- make sure .json files are generated as part of the pypi/ASF build process
- read through the docs and make sure it's clear how to build things if you're not using docker or pypi
  • Loading branch information
mistercrunch committed May 13, 2024
1 parent e9de641 commit f40c29f
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 90,335 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ apache-superset-*.tar.gz*
release.json

# Translation binaries
messages.mo
superset/translations/**/messages.json
superset/translations/**/messages.mo

docker/requirements-local.txt

Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ RUN --mount=type=bind,target=./package.json,src=./superset-frontend/package.json
COPY ./superset-frontend ./
# This seems to be the most expensive step
RUN npm run ${BUILD_CMD}
COPY superset/translations ./superset/translations
COPY ./scripts/po2json.sh ./scripts/po2json.sh
RUN ./scripts/po2json.sh

######################################################################
# Final lean image...
Expand Down Expand Up @@ -92,6 +95,9 @@ RUN --mount=type=cache,target=/root/.cache/pip \
&& flask fab babel-compile --target superset/translations \
&& chown -R superset:superset superset/translations

# Compile translations
RUN pybabel compile -d superset/translations

COPY --chmod=755 ./docker/run-server.sh /usr/bin/
USER superset

Expand Down
Loading

0 comments on commit f40c29f

Please sign in to comment.