Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't wait for ECS service stability for pg-migration deploy #2018

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still need to wait for the ECS task to be provisioned and start running. (the old action version actually just waited for the timeout of 5 minutes--i think we can do a little better than that)


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 Down
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
Loading