sadpandajoe opened a new pull request, #43916: URL: https://github.com/apache/superset/pull/43916
### SUMMARY Speeds up Docker image builds and the `docker compose` dev loop with no behavior changes to the running application: - Restructures the Dockerfile's `lean`/`dev` stages so Python dependencies install before `COPY superset superset`, so the pip/uv layer stays cached across ordinary source-code edits instead of reinstalling on every change. - Folds the `dev` stage's previously uncached `uv pip install .[postgres]` into the same cached editable-install step, and drops the `compileall` pass from `dev` (kept in `lean`, which is what `ci`/`showtime` build from) since it only slows down local iteration without benefiting dev containers. - Guards `docker/docker-bootstrap.sh`'s per-container-start `uv pip install -e ...` reinstalls (superset-core, the app, and the postgres extra) behind a hash of `pyproject.toml` + `requirements/*.txt` (+ `superset-core/pyproject.toml`), stored in a marker inside the venv, so unchanged dependencies are skipped on restart instead of reinstalled every time. - Guards `docker/docker-frontend.sh`'s unconditional `npm install` behind a hash of `package.json`/`package-lock.json` stored in a `node_modules` marker, skipping it when unchanged; adds a `FORCE_NPM_INSTALL` override to opt back into always installing. - Defaults `DISABLE_TS_CHECKER` to `true` for the `superset-node` service in `docker-compose.yml`, matching `docker-compose-light.yml`, so webpack skips its TypeScript type-checking pass (and the several GB of memory it uses) in dev by default. - Skips the full `superset load_examples` reload in `docker/docker-init.sh` on repeat `docker compose up` runs against the same `superset_home` volume once a marker file confirms examples have already loaded, refreshing metadata only instead. Adds `SUPERSET_FORCE_LOAD_EXAMPLES` to force a full reload (e.g. after changing example datasets, or after wiping the database volume while keeping `superset_home`). Cypress runs always take the full-load path since they populate a separate test database. - Updates `docs/admin_docs/installation/docker-compose.mdx`, `docs/developer_docs/contributing/development-setup.md`, `docker/.env`, and `UPDATING.md` to document the new env vars and default-behavior changes. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A (build/tooling change, no UI changes) ### TESTING INSTRUCTIONS - `bash -n` on every edited shell script (`docker/docker-bootstrap.sh`, `docker/docker-frontend.sh`, `docker/docker-init.sh`) passes. - `docker compose -f docker-compose.yml config -q` and `docker compose -f docker-compose-light.yml config -q` both pass. - `docker build --target dev -t superset-dev-loop-test .` and `docker build --target lean -t superset-lean-loop-test .` both build successfully end-to-end. - Smoke-tested both resulting images: `python -c "import superset"`, `uv pip show apache-superset` (confirms `Editable project location: /app`), and `superset --help` all run correctly in both the `dev` and `lean` images. - To manually verify the dev-loop speedups: run `docker compose up --build` once to populate caches/markers, then `docker compose up` again — `docker-bootstrap.sh` should skip the editable reinstalls, `docker-frontend.sh` should skip `npm install`, and `docker-init.sh` should skip the full `load_examples` run (metadata-only instead). - `pre-commit run` passes clean on the changed files. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
