Add Azure Container Apps deployment plan for simplified architecture#398
Draft
itlackey wants to merge 5 commits into
Draft
Add Azure Container Apps deployment plan for simplified architecture#398itlackey wants to merge 5 commits into
itlackey wants to merge 5 commits into
Conversation
Replaces the broader issue-315 scope with a two-container deployment (assistant + guardian only) that exposes the OpenCode web server as the sole ACA ingress behind an IP allowlist, adds an hourly AKM backup job with 7-day rolling retention on Azure Files, and removes the VM, memory, scheduler, and channel-chat containers entirely. https://claude.ai/code/session_01MvxXjvN39TFkakcVohckTC
The AKM database lives in $HOME/.local/state, not the stash directory. Replace the ACA scheduled job approach with a sidecar container inside the assistant app so the backup has direct filesystem access and can use sqlite3's .backup command (online backup API) instead of a raw file copy, which is unsafe against a live SQLite database. https://claude.ai/code/session_01MvxXjvN39TFkakcVohckTC
Azure Files SMB does not implement POSIX advisory locks, so mounting /home/opencode to an SMB share breaks SQLite. Replace the monolithic home share with: - granular Azure Files mounts for non-SQLite subdirectories (.config, .local/share, .akm, /work) - an emptyDir volume for /home/opencode/.local/state (where the AKM db lives) shared between the opencode and akm-backup sidecar containers Add restore-on-start logic to entrypoint.sh that seeds the emptyDir from the latest Azure Files backup snapshot on cold start, making the ephemeral local db durable across restarts at the cost of up to one backup interval of data loss on crash. https://claude.ai/code/session_01MvxXjvN39TFkakcVohckTC
No second container needed. start_backup_loop() spawns a background subshell before the exec into opencode; tini (PID 1) adopts the orphan and it runs for the full container lifetime. Requires adding sqlite3 to the apt-get install line in the assistant Dockerfile. https://claude.ai/code/session_01MvxXjvN39TFkakcVohckTC
The scheduler container is dropped so the assistant needs cron anyway. Replace start_backup_loop with start_cron: installs cron + sqlite3 in the Dockerfile, bakes in akm-backup.sh and cron.d/akm-backup, writes /etc/cron-env from entrypoint for env passthrough, starts the cron daemon before exec. Cron job logs to /proc/1/fd/1 so output appears in ACA log streams. https://claude.ai/code/session_01MvxXjvN39TFkakcVohckTC
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.
Summary
This adds a comprehensive deployment plan for running OpenPalm on Azure Container Apps (ACA) with a simplified architecture that removes the memory and scheduler containers and deploys only the assistant and guardian services.
Key Changes
New deployment plan document (
deploy/azure/PLAN.md): Detailed specification covering:Required image changes: Documents additions to the Dockerfile:
cronandsqlite3packagesakm-backup.sh) and cron job definition (cron.d/akm-backup)Required entrypoint changes: Documents two new shell functions:
maybe_restore_akm_db(): Restores the AKM SQLite database from the latest backup snapshot on cold startstart_cron(): Starts the system cron daemon and writes environment variables for scheduled jobsAzure resource architecture: Specifies resource group, ACA environment, container apps, storage account, Key Vault, and managed identity configuration
Deployment script specification: Outlines
deploy-aca.shwith subcommands for setup, deploy, update-ips, status, and teardownNotable Implementation Details
/etc/cron-envbefore starting the cron daemonThis is a planning document only; actual implementation of the Dockerfile, entrypoint, and deployment script changes will follow in subsequent PRs.
https://claude.ai/code/session_01MvxXjvN39TFkakcVohckTC