mirror of
https://github.com/sredevopsorg/deepseek-kubernetes-sandbox.git
synced 2026-11-03 01:13:24 +00:00
* Rewrite DSH gateway for browser sessions, HTTP and WebSocket - Replace the Flask proxy with a Starlette ASGI app (uvicorn factory), keeping the control plane (claims, wake/suspend, idle sweeper). - Add HttpOnly gateway sessions and a server-side DSH launch-token handshake: read the token from pod logs, exchange it for a dsh-auth cookie, cache per (user, pod UID, Host), refresh once on 401. - Proxy HTTP/SSE and WebSocket (/api/remote.mux) under /u/<user>/, with header stripping/injection, Location rewriting and wake-on-connect. - Add a landing/signup/login page, health endpoint, pinned dependencies, a read-only-rootfs gateway image, 87 cluster-free tests and docs. * Fix DSH probe crash-loop and harden gateway manifests - Probe /favicon.svg instead of /: DSH gates / behind its launch-token cookie and returns 401, which made warm-pool pods crash-loop. - Pass DSH_TRUSTED_HOSTS through the entrypoint as --trusted-host args for public/ingress hosts; keep localhost trusted. - Deploy the published :gateway image, add pods/pods-log RBAC, /healthz probes, read-only rootfs with a /tmp emptyDir and non-root security. - Add optional Traefik Ingress and document the prerequisites. * Update CI, smoke tests, build tooling and docs - Run gateway pytest/ruff and build/smoke-test the image in CI. - Parameterize the DSH build version and pnpm version inputs. - Exercise cookie signup, HTML proxy, WebSocket auth, suspend/wake and delete in run-test-kind.sh. - Add Makefile/build.sh targets and document the architecture, handshake, probes, trusted hosts, troubleshooting and limitations. --------- Co-authored-by: SREDevOpsAgents <agents@sredevops.org>
38 lines
1.1 KiB
Makefile
38 lines
1.1 KiB
Makefile
# Local build and test helpers. Every variable can be overridden, e.g.
|
|
# make image DSH_VERSION=dsh-v0.2.1-rc.2 IMAGE=dsh-web:dev
|
|
# make test
|
|
DSH_VERSION ?= dsh-v0.2.1-rc.2
|
|
PNPM_VERSION ?= 11.28.5
|
|
IMAGE ?= dsh-web:0.2.1-rc.2
|
|
GATEWAY_IMAGE ?= ghcr.io/sredevopsorg/deepseek-kubernetes-sandbox:gateway
|
|
GATEWAY_DIR := examples/dsh-agents-as-a-service/gateway
|
|
PYTHON ?= python3
|
|
DSH_PORT ?= 3080
|
|
|
|
.PHONY: help image gateway run test lint
|
|
|
|
help: ## Show available targets
|
|
@grep -E '^[a-z-]+:.*?## ' $(MAKEFILE_LIST) | sed 's/:.*## /\t/'
|
|
|
|
image: ## Build the DSH Web image
|
|
docker build \
|
|
--build-arg DSH_VERSION=$(DSH_VERSION) \
|
|
--build-arg PNPM_VERSION=$(PNPM_VERSION) \
|
|
-t $(IMAGE) .
|
|
|
|
gateway: ## Build the gateway image
|
|
docker build -t $(GATEWAY_IMAGE) $(GATEWAY_DIR)/
|
|
|
|
run: image ## Build and run the DSH Web image
|
|
docker run --rm -it \
|
|
-p $(DSH_PORT):3080 \
|
|
-v dsh-home:/home/node/.dsh \
|
|
-e DEEPSEEK_API_KEY \
|
|
$(IMAGE)
|
|
|
|
test: ## Run the gateway unit tests (needs requirements + requirements-dev installed)
|
|
cd $(GATEWAY_DIR) && $(PYTHON) -m pytest -q
|
|
|
|
lint: ## Lint the gateway with ruff
|
|
cd $(GATEWAY_DIR) && ruff check .
|