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

Wait 5 minutes for postgres to be ready #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
9 changes: 7 additions & 2 deletions src/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ export const initializeHelm = (
export const installUrbanOS = (
classRef: TerraformStack,
dependsOn: DependsOn
) =>
new Release(classRef, "UrbanOSHelmRelease", {
) => {
// Waits 5 minutes because Postgres marks as complete before it's ready
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 3000);

return new Release(classRef, "UrbanOSHelmRelease", {
Comment on lines +28 to +32
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this will work

Anything in a .ts file only generates the tf.out file. Then the tf.out file is applied by terraform.

My understanding is this will just add a 5 minute delay in the tf.out file being generated, with no affect on the actual tf apply that creates resources from the tf.out.

Other ideas would be, maybe create a helm chart that's entire job is just to take a while to install? That way you could set up a dependency that creates a 5 minute delay incidentally.

delay = install5MinDelay([dependsOn: postgres])
installUrbanOS[(dependsOn: [..., delay])

// by depending on the delay, urbanos install is delayed
// this is a pretty gross idea tho

The "proper" way would be to make the services that depend on postgres, able to attempt reconnecting themselves, but I understand how that would be a larger set of work.

name: "urbanos",
chart: "urban-os",
version: Config.urbanosChartVersion,
Expand All @@ -45,6 +48,8 @@ export const installUrbanOS = (
...dependsOn,
timeout: 600,
});
}


export const installSauron = (
classRef: TerraformStack,
Expand Down