Skip to content

Commit

Permalink
feat: make dbt thread count configurable (#190)
Browse files Browse the repository at this point in the history
* feat: make dbt thread count configurable

* chore: update dbt configuration and environment variables

---------

Co-authored-by: Maria Lorena Rodriguez Viruel <[email protected]>
  • Loading branch information
njuguna-n and Maria Lorena Rodriguez Viruel authored Dec 6, 2024
1 parent b4eefa6 commit 17318c1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions dbt/.dbt/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ default:
target: default
outputs:
default:
threads: "{{ env_var('DBT_THREAD_COUNT') | as_number }}"
type: postgres
host: "{{ env_var('POSTGRES_HOST') }}"
user: "{{ env_var('POSTGRES_USER') }}"
Expand Down
1 change: 1 addition & 0 deletions deploy/cht_sync/values.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ postgres:
port: 5432 # if postgres is outside the cluster

cht_pipeline_branch_url: "https://github.com/medic/cht-pipeline.git#main"
DBT_THREAD_COUNT: 1

# values shared by all couchdb instances
# can be omitted if couchdb instances do not share any values
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ services:
- CHT_PIPELINE_BRANCH_URL=${CHT_PIPELINE_BRANCH_URL}
- DATAEMON_INTERVAL=${DATAEMON_INTERVAL}
- DBT_PACKAGE_TARBALL_URL=${DBT_PACKAGE_TARBALL_URL}
- DBT_THREAD_COUNT=${DBT_THREAD_COUNT}
1 change: 1 addition & 0 deletions env.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ POSTGRES_PORT=5432
# dbt
CHT_PIPELINE_BRANCH_URL="https://github.com/medic/cht-pipeline.git#main"
DATAEMON_INTERVAL=5
DBT_THREAD_COUNT=1

# couchdb
COUCHDB_USER=medic
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"postinstall": "cd couch2pg && npm ci",
"test:e2e": "npm run test:e2e-data && npm run test:e2e-stop-containers && npm run test:e2e-containers && npm run test:e2e-mocha && npm run test:e2e-stop-containers ",
"test:e2e-mocha": "mocha tests/**/*.spec.js --timeout 50000",
"test:e2e-mocha": "mocha tests/**/*.spec.js --timeout 70000",
"lint": "eslint --color --cache .",
"test:e2e-stop-containers": "docker compose --env-file ./tests/.e2e-env -f docker-compose.yml -f docker-compose.couchdb.yml -f docker-compose.postgres.yml -f tests/dbt/docker-compose.yml -f docker-compose.bastion.yml kill && docker compose --env-file ./tests/.e2e-env -f docker-compose.yml -f docker-compose.couchdb.yml -f docker-compose.postgres.yml -f tests/dbt/docker-compose.yml -f docker-compose.bastion.yml rm -f",
"test:e2e-containers": "docker compose --env-file ./tests/.e2e-env -f docker-compose.yml -f docker-compose.couchdb.yml -f docker-compose.postgres.yml -f tests/dbt/docker-compose.yml -f docker-compose.bastion.yml up -d --build --force-recreate && npm run wait-for-couchdb",
Expand Down
3 changes: 2 additions & 1 deletion tests/.e2e-env
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ COUCHDB_HOST="host.docker.internal"
COUCHDB_PORT=5984
COUCHDB_SECURE=false
POSTGRES_HOST=postgres
BASTION_AUTHORIZED_KEYS_FILE=./tests/utils/bastion-ssh-key.pub
BASTION_AUTHORIZED_KEYS_FILE=./tests/utils/bastion-ssh-key.pub
DBT_THREAD_COUNT=1

0 comments on commit 17318c1

Please sign in to comment.