Skip to main content

An extension for the dbt CLI that allows deploying and running jobs remotely

Project description

dbtr

Run and schedule dbt jobs on a self hosted dbt remote server.

Dbtr is an for the dbt CLI that adds the remote subcommand. It lets you deploy a cloud server where you can schedule and execute dbt jobs.

This is a low-cost and practical alternative to dbt Cloud.

Features

  • Deploy a dbt server in one command locally, on GCP, or Azure. (AWS coming soon)
  • Run dbt commands on a remote server rather than your machine
  • Schedule dbt jobs
  • Explore run logs, scheduled jobs, dbt docs, and Elementary reports in a web UI

Installation

Install dbtr with the right extras depending on where your server is (or will be):

pip install 'dbtr[local]'

Available extras:

  • local
  • google
  • azure

Usage

The dbtr CLI is a drop-in replacement for dbt so you can just use it exactly as you would have otherwise (dbt docs):

dbtr debug

[...]

All checks passed!

Use the remote subcommand to deploy a dbt server locally:

dbtr remote deploy --cloud-provider local

[...]

Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)

You can now submit jobs to the server rather than executing them locally:

dbtr remote debug --cloud-provider local --server-url http://localhost:8080

To see the full list of available commands that you can run remotely:

dbtr remote --help

Moving to the cloud

For GCP, this will deploy the server on a Cloud Run instance:

dbtr remote deploy google

Other available options for deployment are local, azure, and soon, aws.

You can now run jobs on this instance:

dbtr remote debug --cloud-provider google --server-url https://my-dbt-server-abcdefghij-ew.a.run.app

Scheduling jobs

If you want to schedule a dbt build every morning at 8 UTC:

dbtr remote build --cloud-provider google --server-url https://my-dbt-server-abcdefghij-ew.a.run.app --schedule-cron '0 8 * * *'

You can also schedule from a configuration file (schedules.yaml):

job-1:
   command: dbtr remote build --server-url https://my-dbt-server-abcdefghij-ew.a.run.app --cloud-provider google
   schedule_cron: "0 8 * * 1"
   description: "Build all the models every Monday at 8 UTC"

job-2:
   command: dbtr remote build --select +customers+ --server-url https://my-dbt-server-abcdefghij-ew.a.run.app --cloud-provider google
   schedule_cron: "0 6 * * *"
   description: "Build all the sales models at 6 UTC"

Then deploy the schedules:

dbtr remote schedule set --schedule-file schedules.yaml --server-url https://my-dbt-server-abcdefghij-ew.a.run.app --cloud-provider google

Frontend

Dbtr comes with a UI where you can take a look at logs, schedules, docs, etc...

dbtr remote frontend --server-url https://my-dbt-server-abcdefghij-ew.a.run.app  --cloud-provider google

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbtr-0.3.1.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

dbtr-0.3.1-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file dbtr-0.3.1.tar.gz.

File metadata

  • Download URL: dbtr-0.3.1.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.0 Darwin/23.2.0

File hashes

Hashes for dbtr-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3da35de2e40b1e645258769ae75d209a2ae9dba9b57b7a3fe73f84776b78d8d8
MD5 9c814611058121cd7c7a0606446c3eed
BLAKE2b-256 62aa847bdd203dcc692ec83efcc7f4eda82af282eabe3cd46a4c7af86dd28fe6

See more details on using hashes here.

File details

Details for the file dbtr-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: dbtr-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.0 Darwin/23.2.0

File hashes

Hashes for dbtr-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93fbc573ee85b83f262cc98abbdbbd3a79dfbb3ffadafad7e63ea4e22e410b9a
MD5 ae12bd84ec82920b7cb0842427e22098
BLAKE2b-256 d497905e1aa2b9c77086088c8cfb0a5f5b16777604101db933a20cb2b8df0ee5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page