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.0.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.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbt_cloud_run_runner-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 700bf99510871f3fcaf134982daa25b2fd0e0320055dd5aa17c0be5ed54f6089
MD5 39a2f6ababb266e0d507cc6995db3453
BLAKE2b-256 250a0541ec121f2ee3f9d1389d2f547d7ea3757b725752c638fb34b291d449c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbt_cloud_run_runner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d30638c4c147cd01f80e55ac17eecf3161fbbfddacb8379697f21938da9cdb4e
MD5 1b79eb2073d95d38a430309b0b90bf82
BLAKE2b-256 335089df23f133a87f2d1821f3a6bf35519f69b60dd9878feca99acc04177e38

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