Skip to content

refactor: the stack runs without one-off containers or default credentials - #414

Merged
HardMax71 merged 3 commits into
mainfrom
refactor/no-one-off-containers
Oct 19, 2026
Merged

HardMax71 merged 3 commits into
mainfrom
refactor/no-one-off-containers

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Every start ran five containers that do one job and exit: base, shared-ca, cert-generator, user-seed and mongo-monitor-user. cert-generator's Kueue install held the backend and frontend back for up to 300 s (#408). Compose also fell back to public default passwords that the deploy guarded with seven checks.

Changes

  • nginx and the backend each make a self-signed certificate on first start. nginx verifies the backend's (proxy_ssl_verify on) through a read-only volume.
  • A ResourceQuota replaces Kueue: same cap (32 CPU, 4Gi requested), no controller, webhooks or CRDs. The worker creates the namespace, policy and quota itself, using k3s's own kubeconfig.
  • The backend seeds the users and the collector's Mongo user before gunicorn starts, and base is a stage of backend/Dockerfile.
  • Compose secrets have no defaults. .env comes from .env.example in dev and CI, and the deploy writes it on the server.

Warning

After the first deploy: run kubectl delete -f https://github.com/kubernetes-sigs/kueue/releases/download/v0.20.1/manifests.yaml on the server, since Kueue's pod webhook still intercepts every pod while installed. Secrets go into .env single-quoted (none may contain '). The old service account and the shared_ca volume stay until removed by hand.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling changes

Test Plan

  • Backend unit tests pass (cd backend && uv run pytest tests/unit)
  • Frontend unit tests pass (cd frontend && npm run test)
  • Backend E2E tests pass (docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')
  • Frontend E2E tests pass (cd frontend && npm run test:e2e)
  • API spec and client regenerated if routes or schemas changed (./deploy.sh openapi, then ./deploy.sh types), never edited by hand
  • Manual testing performed

Validation: ruff, mypy --strict, 573 backend unit tests, frontend lint, svelte-check and mkdocs --strict pass. On a bare local k3s v1.37.1 the worker created the namespace, policy and quota, an execution through https://localhost:5001 printed "hello from k3s", a 5Gi pod got "exceeded quota", and nginx kept verifying after a backend restart.

Checklist

  • My code follows the project's style guidelines
  • I have run pre-commit run --all-files and all checks pass
  • I have added tests that prove my fix/feature works
  • I have updated documentation if needed
  • My changes don't introduce new warnings

…tials

base, shared-ca, cert-generator, user-seed and mongo-monitor-user are gone.
nginx makes its own self-signed certificate at start unless one is mounted,
and the backend serves plain http on 8000 inside the compose network.
k3s applies k8s/ (Kueue's release manifest, the namespace and the queues)
from its manifests folder, and the worker reads k3s's own kubeconfig.
The backend seeds the users and the collector's Mongo user before gunicorn
starts. Compose secrets have no defaults: .env comes from .env.example in
dev and CI, and the deploy writes it on the server.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b48d0b21-52a1-4cc8-8789-4b90aa08643e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: frontend Svelte UI and the generated API client area: api FastAPI routes, auth, rate limiting, settings area: deploy Compose, deploy.sh, images, release workflow, production host area: ci GitHub workflows, test infrastructure, repo tooling labels Oct 19, 2026
@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
backend-e2e 82.70% <35.00%> (-0.07%) ⬇️
backend-unit 74.87% <100.00%> (+0.35%) ⬆️
frontend-unit 92.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/app/core/container.py 87.50% <ø> (ø)
backend/app/core/providers.py 97.57% <100.00%> (+2.46%) ⬆️
backend/app/services/k8s_worker/pod_builder.py 100.00% <ø> (ø)
backend/app/services/k8s_worker/worker.py 39.04% <100.00%> (+18.17%) ⬆️
backend/app/services/pod_monitor/monitor.py 96.55% <ø> (ø)
backend/app/settings.py 98.21% <100.00%> (+0.03%) ⬆️
Components Coverage Δ
Backend 92.46% <100.00%> (+0.33%) ⬆️
Frontend 92.60% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…nd over verified HTTPS

Kueue only capped what executor pods request (32 CPU, 4Gi), which a
ResourceQuota does without a controller, webhooks or CRDs. The worker now
creates the namespace and applies executor-quota next to the NetworkPolicy,
so k8s/ and its 28k-line manifest are gone, along with every step that
linked or mounted it.

The backend serves TLS on 443 again, with a self-signed certificate it makes
on first start and keeps in the backend_tls_cert volume. nginx mounts that
volume read-only and proxies with proxy_ssl_verify on against it.
@github-actions github-actions Bot added the area: execution Queue, scheduler, k8s worker, pod monitor, result processor, executor pods, runtimes label Oct 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

@HardMax71
HardMax71 enabled auto-merge (squash) October 19, 2026 20:28
@HardMax71
HardMax71 merged commit 9e21321 into main Oct 19, 2026
36 of 38 checks passed
@HardMax71
HardMax71 deleted the refactor/no-one-off-containers branch October 19, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api FastAPI routes, auth, rate limiting, settings area: ci GitHub workflows, test infrastructure, repo tooling area: deploy Compose, deploy.sh, images, release workflow, production host area: execution Queue, scheduler, k8s worker, pod monitor, result processor, executor pods, runtimes area: frontend Svelte UI and the generated API client documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants