Skip to content

Epic 6.3: Deployment Architecture - Config, Shutdown, Dockerfile#52

Merged
Deepfreezechill merged 3 commits intomainfrom
epic/6.3-deployment
Apr 7, 2026
Merged

Epic 6.3: Deployment Architecture - Config, Shutdown, Dockerfile#52
Deepfreezechill merged 3 commits intomainfrom
epic/6.3-deployment

Conversation

@Deepfreezechill
Copy link
Copy Markdown
Owner

Epic 6.3: Deployment Architecture

What

Add production deployment infrastructure: centralized config, graceful shutdown, Dockerfile.

New Files

  • openspace/deploy/config.py - DeployConfig (frozen, env-based, validated)
  • openspace/deploy/shutdown.py - GracefulShutdownHandler (signal-aware, task draining)
  • Dockerfile - Multi-stage (python:3.13-slim, non-root, HEALTHCHECK)
  • .dockerignore - Build context exclusions
  • tests/test_deployment.py - 26 tests

Metrics

  • 1,910 tests passed, 0 failures
  • 672 lines added across 7 files

- DeployConfig: frozen dataclass, env-based with validation (port, transport, log level)
- GracefulShutdownHandler: signal-aware, drains in-flight tasks, timeout, idempotent
- Multi-stage Dockerfile: python:3.13-slim, non-root user, HEALTHCHECK, STOPSIGNAL
- .dockerignore: excludes tests, frontend, secrets, build artifacts
- 26 new tests (1,910 total passed)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🔒 Phase Gate Enforcement — 🚫 FAIL

Check Result Detail
Issue linkage No linked issues found. PR must contain "Closes #N", "Fixes #N", or "Resolves #N".

Verdict: FAIL
Timestamp: 2026-04-07T01:52:07.713Z
Run: View workflow run


How to fix: Ensure all prerequisite phases are complete, or add emergency:bypass label with a ## Bypass Reason section in the PR body.

Brian Krafft and others added 2 commits April 6, 2026 18:40
- Expand .dockerignore: add docs/, showcase/, crypto patterns, caches
- Add 13 new adversarial tests (39 total): port boundaries, boolean parsing,
  non-integer env, empty env, task exception during drain, auto-cancel during
  shutdown, zero hooks/tasks, timeout minimum, Dockerfile instruction checks,
  wiring verification for DeployConfig, /health route, shutdown handler
- Verify config log_level normalization (lowercase → UPPER)
- Verify shutdown timeout minimum (0 rejected, -1 rejected)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s, HEALTHCHECK

- Wire GracefulShutdownHandler into uvicorn lifecycle via serve_with_shutdown()
  with finally block guaranteeing shutdown runs after server.serve()
- Move /health endpoint OUTSIDE BearerTokenMiddleware for K8s probe access
- Set uvicorn timeout_graceful_shutdown to half of shutdown budget
- Change Dockerfile OPENSPACE_SHUTDOWN_TIMEOUT from 30 to 8 (fits Docker 10s)
- Replace HEALTHCHECK with real HTTP /health endpoint check (not false-positive import)
- Add 2 new tests: /health-outside-auth, shutdown-after-uvicorn, Docker timeout alignment
- 41 deployment tests, 1925 total passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Deepfreezechill Deepfreezechill merged commit 81af1a3 into main Apr 7, 2026
0 of 5 checks passed
Deepfreezechill pushed a commit that referenced this pull request Apr 7, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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