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

bugfix(#28): fixed make prod bug #30

Merged
merged 5 commits into from
Jul 5, 2023
Merged

bugfix(#28): fixed make prod bug #30

merged 5 commits into from
Jul 5, 2023

Conversation

samuelimoisili
Copy link
Contributor

Added a docker compose file to fix make prod postgrest startup issue.

Closes #28

@samuelimoisili samuelimoisili changed the title fixed make prod bug bugfix(28): fixed make prod bug Jun 22, 2023
@samuelimoisili samuelimoisili changed the title bugfix(28): fixed make prod bug bugfix(28): fixed make prod bug Jun 22, 2023
@andrablaj
Copy link
Member

I managed to reproduce @mrjones-plip's bug locally on the main branch.

If I run make prod on this PR's branch (after running CHT locally with the docker helper), I get the following error in the dbt container:

Unable to connect! could not translate host name "postgres" to address: Name or service not known

@samuelimoisili
Copy link
Contributor Author

@andrablaj You'll to setup a PostgreSQL database and update the following environment variables:

DBT_POSTGRES_HOST=
DBT_POSTGRES_USER=
DBT_POSTGRES_PASSWORD=
POSTGRES_DB=
POSTGRES_TABLE=
DBT_POSTGRES_SCHEMA=
POSTGRES_SCHEMA=

@mrjones-plip
Copy link
Contributor

@andrablaj - I'm waaaay behind on my mail/slack/todo queue - removing myself as a reviewer to unblock.

@mrjones-plip mrjones-plip removed their request for review June 22, 2023 22:13
@njogz
Copy link
Contributor

njogz commented Jun 23, 2023

Unassigning myself as a reviewer for now since I am away today and on Monday

@njogz njogz removed their request for review June 23, 2023 06:15
@samuelimoisili samuelimoisili changed the title bugfix(28): fixed make prod bug bugfix(#28): fixed make prod bug Jun 27, 2023
@andrablaj
Copy link
Member

@samuelimoisili, following up here with some items from our 1:1 discussion:

  • I didn't see any mention in the documentation about installing PostgreSQL as a prerequisite to run cht-sync. Can you please add that step in the README?
  • You mentioned having a docker-compose file for setting up PostgreSQL locally. Can you please share it in the repo with instructions on how to use it and how it reflects in the .env file variables?

Thanks!

@njogz
Copy link
Contributor

njogz commented Jun 28, 2023

Is this PR still relevant given you do away with the makefile in this PR?

@samuelimoisili
Copy link
Contributor Author

samuelimoisili commented Jun 28, 2023

@njogz Yes, it is relevant. It introduces a new docker-compose file.

Copy link
Member

@andrablaj andrablaj left a comment

Choose a reason for hiding this comment

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

🎆 Awesome, I managed to run make prod successfully locally, with the latest CHT run via docker helper. Great job!

Nevertheless, the documentation needs updates as I needed to perform extra steps to have this running correctly.

  1. Content of .env:
# project wide: optional
COMPOSE_PROJECT_NAME=pipeline

# postgrest and pogresql: required environment variables for 'gamma', prod and 'local'
POSTGRES_USER=root
POSTGRES_PASSWORD=supercoolpassword
POSTGRES_DB=data
POSTGRES_TABLE=couchdb
POSTGRES_SCHEMA=v1

# dbt: required environment variables for 'gamma', 'prod' and 'local'
DBT_POSTGRES_USER=dbt_user
DBT_POSTGRES_PASSWORD=supercoolpassword
DBT_POSTGRES_SCHEMA=dbt
DBT_POSTGRES_HOST=yourIP
CHT_PIPELINE_BRANCH_URL=https://github.com/medic/cht-pipeline.git#main

# couchdb and logstash: required environment variables for 'gamma', 'prod' and 'local'
COUCHDB_USER=medic
COUCHDB_PASSWORD=password
COUCHDB_DB=medic-users-meta
COUCHDB_HOST=yourCHThost
COUCHDB_PORT=yourCHTport
COUCHDB_SECURE=false

# superset: required environment variables for 'gamma', 'prod' and 'local'
SUPERSET_PASSWORD=password
[email protected]
  1. Run make prod
  2. Run docker-compose -f docker-compose.postgres.yml -f docker-compose.yml up postgres.

I think it's worth mentioning that the user can skip step 3 if they have a local instance of postgreSQL, and update .env accordingly.

Copy link
Member

@andrablaj andrablaj left a comment

Choose a reason for hiding this comment

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

:shipit:

env.template Outdated Show resolved Hide resolved
Co-authored-by: Andra Blaj <[email protected]>
@samuelimoisili samuelimoisili merged commit e563c35 into main Jul 5, 2023
2 checks passed
@samuelimoisili samuelimoisili deleted the 28-make-prod branch July 5, 2023 18:02
@medic-ci
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

running "make production": no such service: postgrest
5 participants