Deployment reconciliation, observed status tracking, and restart policy controls#57
Open
zbal wants to merge 9 commits intodevelopmentfrom
Open
Deployment reconciliation, observed status tracking, and restart policy controls#57zbal wants to merge 9 commits intodevelopmentfrom
zbal wants to merge 9 commits intodevelopmentfrom
Conversation
Rebase: fix formating on README for new ENV VARS
…d - allowing to track drift
…ers and deployments
… change, add computed_status logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Deployment status in the DB can drift from real container state (crashed/stopped/removed). This creates confusing UI states and makes recovery unclear. We need a reliable observed snapshot, a reconciliation loop, and a controlled restart policy to keep deployment state accurate and actionable.
Summary
Key changes
models.py: new observed_* fields and computed_status property.reconcile.py: Docker inspection + observed updates + change-only events.reconcile.py+jobs.py: scheduled ARQ cron task.project.py: POST /{team_slug}/projects/{project_name}/deployments/{deployment_id}/reconcile.reconcile.sh: one‑off reconcile CLI.deployment.py: Docker restart policy (on-failure + retries)..env.example,.env.dev.example: new settings (reconcile interval, restart policy).Config
RECONCILE_INTERVAL_SECONDS(default: 60)DEPLOYMENT_RESTART_POLICY(default: on-failure)DEPLOYMENT_RESTART_MAX_RETRIES(default: 5)Testing
reconcile.sh --deployment <id>→ verify observed_* updates -- gooddeployment_observed_updateand checkcomputed_status.Follow‑ups (not included)
SSE handler + UI templates for computed status.
Manual action endpoints (restart/stop/cleanup).