Skip to main content

A client library for running dbt projects on Google Cloud Run

Project description

dbt-cloud-run-runner

A Python client library for running dbt projects on Google Cloud Run.

Installation

pip install dbt-cloud-run-runner

Usage

from dbt_cloud_run_runner import Client

# Initialize the client
client = Client(
    gcp_project="your-gcp-project",
    gcs_bucket="your-gcs-bucket",
    region="us-central1",  # optional, defaults to us-central1
)

# Prepare a dbt project for BigQuery
setup = client.prepare_bigquery(
    service_account_key={"type": "service_account", ...},  # Your service account key JSON
    target_project="your-bigquery-project",
    target_dataset="your_dataset",
    path_to_local_dbt_project="./path/to/dbt/project",
    image="us-docker.pkg.dev/delphiio-prod/public-images/dbt-runner:v0.0.7",
)

# Run the dbt project on Cloud Run
execution_id = client.run(setup)
print(f"Execution started: {execution_id}")

# Wait for completion
status = client.wait_for_completion(execution_id)
print(f"Execution finished with state: {status.state.value}")

# Or poll status manually
status = client.get_status(execution_id)
print(f"Current state: {status.state.value}")

Features

  • Automatic GCS setup: Uploads your dbt project and credentials to GCS with signed URLs
  • Cloud Run job management: Creates and manages Cloud Run jobs automatically
  • BigQuery integration: Generates profiles.yml for BigQuery targets
  • Status monitoring: Track execution status with polling or wait for completion

Requirements

  • Python 3.9+
  • Google Cloud project with Cloud Run and GCS enabled
  • Service account with appropriate permissions:
    • Cloud Run Admin (roles/run.admin)
    • Storage Admin (roles/storage.admin) on the GCS bucket
    • BigQuery access for the target project/dataset

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

dbt_cloud_run_runner-0.1.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_cloud_run_runner-0.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file dbt_cloud_run_runner-0.1.1.tar.gz.

File metadata

  • Download URL: dbt_cloud_run_runner-0.1.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for dbt_cloud_run_runner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e4075c3098c0f804d7ac4acb27122929eb4a043ceb7a8430b7b8c3721420a09d
MD5 6ab585c8efb54836939e8d6c16ff8a6a
BLAKE2b-256 85f3b95b238afd104c137a38454d7d0527889945b3593d298a31861f087194c0

See more details on using hashes here.

File details

Details for the file dbt_cloud_run_runner-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dbt_cloud_run_runner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba26184b01b4177a1d8fc7c8529c467f9b9cbed9c16b231710ce643aa3586f04
MD5 978d9484d0c4be3df189c490a1c60c2d
BLAKE2b-256 1a57fd449d6658f07472513d802ef2212c2f9462a29c9561645391ab80759398

See more details on using hashes here.

Supported by

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