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

fix: Configure cron db from environment #628

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Conversation

morgsmccauley
Copy link
Collaborator

@morgsmccauley morgsmccauley commented Apr 2, 2024

The admin/cron connection is currently hard-coded to the cron database, but this needs to be configurable so that we can use the default DB (postgres) locally.

Additionally, this PR combines the pgbouncer / pg_cron init scripts and uses the combined output in both docker compose and integration tests.

@morgsmccauley morgsmccauley marked this pull request as ready for review April 2, 2024 19:32
@morgsmccauley morgsmccauley requested a review from a team as a code owner April 2, 2024 19:32
Copy link
Collaborator

@darunrs darunrs left a comment

Choose a reason for hiding this comment

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

Nice! While you're here, you might want to also update the docker compose to specify your dockerfile instead of the postgres:14 image. I think the image tag is overriding the usage of your new postgres Dockerfile.

Think just need a small update to the integ tests too.

}

const defaultConfig: Config = {
cronDatabase: process.env.CRON_DATABASE,
hasuraHostOverride: process.env.HASURA_HOST_OVERRIDE,
hasuraPortOverride: process.env.HASURA_POST_OVERRIDE ? Number(process.env.HASURA_POST_OVERRIDE) : undefined
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: HASURA_PORT_OVERRIDE PORT vs POST

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, that's not a nit, that's a genuine error :D

Comment on lines 44 to 45
hasuraHostOverride: process.env.HASURA_HOST_OVERRIDE,
hasuraPortOverride: process.env.HASURA_POST_OVERRIDE ? Number(process.env.HASURA_POST_OVERRIDE) : undefined
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will be useful for local development, i.e. we start Runner outside of docker, and therefore need to use a different host/port` value to communicate with Postgres. These should only exist within local dev.

@morgsmccauley morgsmccauley requested a review from darunrs April 2, 2024 21:27
@morgsmccauley morgsmccauley merged commit ff87f0b into main Apr 2, 2024
3 checks passed
@morgsmccauley morgsmccauley deleted the fix/local-pg-cron branch April 2, 2024 21:27
This was referenced Apr 22, 2024
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.

2 participants