Skip to content

Keep COMPOSE_PROFILES when start scripts add ui or backup profiles - #443

Merged
ArnavAgrawal03 merged 1 commit into
mainfrom
arnav/iqor-email-and-testing
Sep 25, 2026
Merged

ArnavAgrawal03 merged 1 commit into
mainfrom
arnav/iqor-email-and-testing

Conversation

@ArnavAgrawal03

@ArnavAgrawal03 ArnavAgrawal03 commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Compose ignores COMPOSE_PROFILES whenever a --profile flag is passed. The start scripts passed --profile ui, and since #442 also --profile backup and --profile backup-s3. So turning on scheduled backups silently dropped any profile set in .env, such as ollama.

I hit this in a restore drill on EC2. After restore --restore-config, Morphik started without its Ollama container, so embeddings would have failed.

COMPOSE_PROFILES=ollama in .env:
  docker compose config --services                   -> a o
  docker compose --profile backup config --services  -> a b    (ollama dropped)
  COMPOSE_PROFILES=ollama,backup                     -> a b o

The checked-in start-morphik.sh, the installer-generated copy, and the PowerShell one now add ui, backup, and backup-s3 to COMPOSE_PROFILES instead of passing flags. This also fixes the older ui plus ollama case.

A failed S3 upload now also mentions the EC2 metadata hop limit. The AWS CLI only says "Unable to locate credentials".

Test plan

  • pytest core/tests/unit/test_docker_lifecycle.py core/tests/unit/test_docker_installer_safety.py core/tests/unit/test_backup_tool.py: 50 passed. A new test covers COMPOSE_PROFILES="ollama,ui" in .env with backups on, for both the checked-in and the generated script.
  • The generated start-morphik.ps1 run under pwsh 7.4 with a stubbed docker gives COMPOSE_PROFILES=ollama,ui,backup,backup-s3 and passes no --profile flags.
  • On EC2 host B, the fixed start-morphik.sh started ollama, backup, and backup-s3 together. The restored deployment then matched the original exactly.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Compose ignores COMPOSE_PROFILES whenever a --profile flag is passed.
The start scripts passed --profile for ui and, since #442, for backup
and backup-s3. Enabling scheduled backups therefore dropped profiles set
in .env, such as ollama. A restore drill on EC2 hit this: after restore,
the Ollama container never started, so embeddings would have failed.

The start scripts (checked-in, installer-generated, and PowerShell) now
merge ui, backup, and backup-s3 into COMPOSE_PROFILES instead of passing
flags. A failed S3 upload also explains the EC2 metadata hop limit,
because the AWS CLI only reports "Unable to locate credentials".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ArnavAgrawal03
ArnavAgrawal03 merged commit a9cc641 into main Sep 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant