ERA-1706 Add safe Docker app rebuild workflow#100
Draft
shrkz1 wants to merge 12 commits into
Draft
Conversation
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.
What changed
Why
ERA-1706 replaces the manual Docker repository and application rebuild procedure with a repeatable workflow. The Docker checkout does not decide which release or tag should be installed. The running Eramba application requests a canonical image-switch plan from the support backend, and this command verifies that plan against the live deployment before making changes.
Rollout prerequisites
The workflow can be enabled only after all of the following are available:
Older installations whose running image does not contain image_switch_plan must use the manual image-switch procedure once to reach a compatible baseline. There is intentionally no operator option for overriding the target tag.
Usage
Run the command from the Docker repository root.
Preview a Community rebuild
The edition is detected from the currently running eramba container. Community images must use ghcr.io/eramba/eramba:.
A dry run performs the complete preflight and target validation. It may pull the exact Community image, or load the supplied Enterprise archive, and it creates a temporary container to inspect the target VERSION. It does not update .env, stop or replace deployment containers, or remove deployment volumes.
If the support backend returns required=false, the command prints "nothing to do" and exits successfully.
Run an interactive Community rebuild
Before mutation, the command prints:
The operator must type yes once to approve the plan and again to confirm that a current recoverable backup exists.
The backup confirmation is an operator assertion. The command does not create or validate a database backup.
Run an Enterprise rebuild
Download the approved Enterprise image archive before starting:
The archive must be a readable local file. The command loads it with docker load and requires it to provide the exact repository and immutable tag returned by the support plan. An Enterprise plan must use the archive distribution.
Use --dry-run with the same arguments to validate the archive without mutating the deployment:
Update the Docker checkout first
This option requires a clean checkout on an attached branch. It runs:
The command then re-executes itself under the same rebuild lock and continues with the original arguments. A dirty checkout, detached HEAD or non-fast-forward update aborts before Docker preflight.
The option can be combined with the normal Community or Enterprise arguments.
Non-interactive execution
Both flags are required for a non-interactive real rebuild:
For Enterprise:
Using --yes without --backup-confirmed is rejected before deployment preflight.
What preflight verifies
Before changing deployment state, the command verifies:
Community targets are pulled from the registry. Enterprise targets are loaded from the supplied archive. Both are acquired and validated before downtime.
Rebuild sequence
After confirmation, the command:
MySQL and Redis stay running throughout the normal rebuild. The database volume, application data volume, application logs volume and trigger-storage volume are preserved.
Failure and recovery behavior
Before the migration boundary
The migration boundary begins immediately before the first target eramba start, because its entrypoint may run database migrations.
If a failure happens before that boundary, the command attempts to:
If restoring the previous tag fails, application services are not started with an unknown tag.
At or after the migration boundary
The command does not automatically downgrade application code after the target eramba start has been attempted, because database migrations may already have run.
Instead it:
Recovery may require resolving the target failure or restoring the database backup before returning to the previous application version.
The diagnostics include run state, selected Docker inspection data and service logs. They do not copy the deployment .env.
Validation
No real or destructive Docker rebuild was executed during validation.