Skip to content

Docker Dependency Removal#256

Merged
guillaume-byte merged 2 commits into
devfrom
feature/pip-native-ui
Jul 21, 2026
Merged

Docker Dependency Removal#256
guillaume-byte merged 2 commits into
devfrom
feature/pip-native-ui

Conversation

@guillaume-byte

@guillaume-byte guillaume-byte commented Jul 20, 2026

Copy link
Copy Markdown
Member

Remove every Docker dependency and include the built UI directly in the Python package.

  • Before, deps. were Docker + Python
  • Now, deps. are Python
    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.

guillaume-byte and others added 2 commits July 19, 2026 17:04
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>
@guillaume-byte guillaume-byte changed the title Feature/pip native UI Docker Dependency Removal Jul 20, 2026
@guillaume-byte
guillaume-byte merged commit f45510b into dev Jul 21, 2026
14 checks passed
@guillaume-byte
guillaume-byte deleted the feature/pip-native-ui branch July 21, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant