Docker Dependency Removal#256
Merged
Merged
Conversation
Ship the Weights Studio UI inside the pip wheel and serve it from a single pure-Python server (stdlib http.server + existing grpcio, no new deps), replacing the Envoy + nginx Docker stack. TensorBoard-style. - weightslab/ui/server.py: serves the vendored built SPA, injects a same-origin runtime config, and proxies gRPC-Web (grpc-web-text and +proto) generically to the backend gRPC server. Optional TLS/mTLS from WEIGHTSLAB_CERTS_DIR. - weightslab/ui/static/: vendored built SPA (npm run build:embed). - ui_docker_bridge.py: bare `weightslab start` launches the native UI (--port/--host/--backend-*/--no-browser/--certs). `start example` and the legacy Docker `ui launch` are unchanged. - pyproject.toml: bundle ui/static/** in the wheel. Also make the package import torch-free until the training API is used, so the `weightslab` CLI (UI server) boots in ~0.1s instead of ~6s: - __init__.py and utils/__init__.py: lazy (PEP 562) re-exports of the torch-heavy training helpers. - tunnel.py: defer the utils.tools import to its call site. Verified: real SPA in-browser makes gRPC-Web calls to /api (200, 0 errors); wheel bundles the UI; wheel-installed `weightslab start` boots and serves it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ree UI The UI, the CLI, the examples, and the docs no longer reference Docker/Envoy. `weightslab start` serves the bundled SPA and proxies gRPC-Web from one pure- Python process; the old Docker/Envoy/nginx stack is gone. CLI: - Rename weightslab/ui_docker_bridge.py -> weightslab/cli.py (entry point weightslab.cli:main). Drop every Docker helper and the `ui launch` command. Keep `se`, `start` (native UI), `start example`, `cli`, `tunnel`. - Relocate the cert-generation scripts docker/docker/utils -> weightslab/ui/utils and rename the envoy-* certs to ui-* (there is no Envoy); the backend cert SAN drops host.docker.internal for localhost. Server: - weightslab/ui/server.py reads the ui-server/ui-client certs and now injects the full window.WS_* feature/cache config from env vars — the faithful, Docker-free replacement for the old nginx config.js, so the UI stays tunable without rebuild. Packaging: - pyproject: entry point -> weightslab.cli:main; package-data drops docker/**, adds ui/utils/** (cert scripts) and keeps ui/static/** + examples/**. - Remove weightslab/docker/** and the Docker_training examples. Docs & tests: - docs: drop usage/docker.rst; scrub Docker/Envoy/nginx from README + docs (nginx-env -> "injected by weightslab start"; systemd/Docker supervisor example -> systemd). - tests: replace test_ui_docker_bridge.py with test_cli.py (28 pass) covering se/start/example/cli/help; no Docker helpers left to test. - Add weightslab/ui/utils/sync-frontend.sh to vendor the built SPA into ui/static. Verified: `weightslab start` boots and serves the bundled UI (HTTP 200) with the env->window.WS_* injection working; CLI tests pass; package imports cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove every Docker dependency and include the built UI directly in the Python package.
This change includes removing everything related to Docker from code to docs.
The UI is built locally from the Weights Studio repository (private), or included in the CI.