fix(auth): seed Authentik blueprint before compose gateway - #788
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe Compose stack adds a retrying Authentik blueprint-init service, removes blueprint mounts from the main Authentik containers, and gates gateway startup on successful blueprint application. Documentation and static tests cover the new wiring. ChangesAuthentik blueprint initialization
Sequence Diagram(s)sequenceDiagram
participant authentik-server
participant authentik-worker
participant authentik-blueprint-init
participant gateway
authentik-server-->>authentik-blueprint-init: service_healthy
authentik-worker-->>authentik-blueprint-init: service_healthy
authentik-blueprint-init->>authentik-blueprint-init: retry apply nemo.yaml
authentik-blueprint-init-->>gateway: service_completed_successfully
gateway->>gateway: start
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@contrib/auth/authentik/compose/implementation-details.md`:
- Line 20: Replace the hardcoded Authentik product names in
implementation-details.md at lines 20-20 and 36-37 with the configured Sphinx
product-name substitution, preserving the surrounding prose and links.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 6546d2e3-b534-4100-b3ef-57409b22c70a
📒 Files selected for processing (3)
contrib/auth/authentik/compose/docker-compose.ymlcontrib/auth/authentik/compose/implementation-details.mdtests/auth_idp/static/test_provider_layout.py
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
contrib/auth/authentik/compose/docker-compose.yml (1)
152-169: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse
commandhere
ghcr.io/goauthentik/server:2024.12already setsENTRYPOINT ["dumb-init", "--", "ak"], socommand: [apply_blueprint, /blueprints/custom/nemo.yaml]keeps the wrapper intact and avoids replacing it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@contrib/auth/authentik/compose/docker-compose.yml` around lines 152 - 169, Update the authentik-blueprint-init service to use a command override containing apply_blueprint and /blueprints/custom/nemo.yaml instead of replacing the image entrypoint. Preserve the image’s dumb-init and ak entrypoint wrapper while keeping the existing environment, volumes, dependencies, and network settings unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@contrib/auth/authentik/compose/docker-compose.yml`:
- Around line 152-169: Update the authentik-blueprint-init service to use a
command override containing apply_blueprint and /blueprints/custom/nemo.yaml
instead of replacing the image entrypoint. Preserve the image’s dumb-init and ak
entrypoint wrapper while keeping the existing environment, volumes,
dependencies, and network settings unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b6a4129a-bf21-4cd4-a6de-e45997bdd482
📒 Files selected for processing (2)
contrib/auth/authentik/compose/docker-compose.ymltests/auth_idp/static/test_provider_layout.py
8619bad to
ea859ef
Compare
Signed-off-by: Ryan S <267728323+ironcommit@users.noreply.github.com>
ea859ef to
cfdaa68
Compare
Summary
Fix the Authentik Compose startup races seen while validating #631:
contrib/auth/authentik/helm/files/blueprints/nemo.yamlwith a dedicated one-shotauthentik-blueprint-initservice instead of relying on Authentik custom blueprint auto-discovery from the long-running server/worker containers.authentik-blueprint-initcompleting successfully, so/health/gateway/readyis not polled until the NeMo Authentik applications/providers/users are seeded.ak apply_blueprintbecause Authentik can report server/worker health before its built-in default blueprints have created the provider flows and OAuth scope mappings referenced bynemo.yaml.CI Failures
29758464168/88408033334: gateway readiness returned HTTP 503 because Envoy saw Authentik return 404 for/application/o/nemo/.well-known/openid-configurationduring startup.29762432224/88421559941: after simplifying the init service to one directak apply_blueprintcall,authentik-blueprint-initexited 1 with blueprint validation errors for missing default provider flows and OAuth scope mappings. That confirmed Authentik container health alone is not a sufficient gate.Testing
docker compose -f contrib/auth/authentik/compose/docker-compose.yml config --quietgit diff --checkuv run --frozen pytest tests/auth_idp/static/test_provider_layout.py tests/auth_idp/static/test_docs_links.py -qauthentik-blueprint-initwith--exit-code-from authentik-blueprint-initexited 0.Summary by CodeRabbit
New Features
Documentation
Tests