Skip to content

Commit

Permalink
Merge pull request #2018 from cardstack/pg-migration-deploy-fix
Browse files Browse the repository at this point in the history
don't wait for ECS service stability for pg-migration deploy
  • Loading branch information
habdelra authored Jan 8, 2025
2 parents ca1657f + 21e06ed commit b24ab77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
dockerfile: "packages/ai-bot/Dockerfile"

deploy-ai-bot:
needs: [build-ai-bot, migrate-db]
needs: [build-ai-bot, post-migrate-db]
name: Deploy ai-bot to AWS ECS
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main
secrets: inherit
Expand All @@ -34,6 +34,7 @@ jobs:
cluster: ${{ inputs.environment }}
service-name: "boxel-ai-bot-${{ inputs.environment }}"
image: ${{ needs.build-ai-bot.outputs.image }}
wait-for-service-stability: false

build-host:
name: Build host
Expand Down Expand Up @@ -100,10 +101,18 @@ jobs:
cluster: ${{ inputs.environment }}
service-name: "boxel-pg-migration-${{ inputs.environment }}"
image: ${{ needs.build-pg-migration.outputs.image }}
wait-for-service-stability: false

post-migrate-db:
name: Wait for db-migration
needs: [migrate-db]
runs-on: ubuntu-latest
steps:
- run: sleep 240

deploy-realm-server:
name: Deploy realm server
needs: [build-realm-server, deploy-host, migrate-db]
needs: [build-realm-server, deploy-host, post-migrate-db]
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main
secrets: inherit
with:
Expand All @@ -112,3 +121,4 @@ jobs:
cluster: ${{ inputs.environment }}
service-name: "boxel-realm-server-${{ inputs.environment }}"
image: ${{ needs.build-realm-server.outputs.image }}
wait-for-service-stability: false
4 changes: 2 additions & 2 deletions packages/runtime-common/realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ export class Realm {
#router: Router;
#log = logger('realm');
#perfLog = logger('perf');
#startTime = Date.now();
#updateItems: UpdateItem[] = [];
#flushUpdateEvents: Promise<void> | undefined;
#recentWrites: Map<string, number> = new Map();
Expand Down Expand Up @@ -590,6 +589,7 @@ export class Realm {

async #startup() {
await Promise.resolve();
let startTime = Date.now();
let isNewIndex = await this.#realmIndexUpdater.isNewIndex();
let promise = this.#realmIndexUpdater.run();
if (isNewIndex) {
Expand All @@ -601,7 +601,7 @@ export class Realm {
data: { type: 'full', realmURL: this.url },
});
this.#perfLog.debug(
`realm server startup in ${Date.now() - this.#startTime}ms`,
`realm server ${this.url} startup in ${Date.now() - startTime} ms`,
);
}

Expand Down

0 comments on commit b24ab77

Please sign in to comment.