DBT workflows factory for Google Cloud Platform
Project description
dbt-workflows-converter
Creates dbt based GCP workflows.
Installation
Use the package manager pip to install dbt-workflows-converter for [dp (data-pipelines-cli)]:
pip install dbt-workflows-converter
Usage
In order to run the dbt-workflows-converter, you will need:
manifest.json
file with dbt manifestparams
for the special parameters.
Params
Parameters specified for the converters are:
image_uri
: url address for the imageregion
: the location where tge workflow executes on GCP (example:us-central1
oreurope-west1
)full_command
: full command executed on image (example:"dbt --no-write-json run --target env_execution --project-dir /dbt --profiles-dir /root/.dbt --select "
)remote_path
: gcs mount path (example:"/mnt/disks/var"
)key_volume_mount_path
: path for mounting the volume containg key (ex./mnt/disks/var/keyfile_name.json
)key_volume_path
: path for mounting (ex.["/mnt/disks/var/:/mnt/disks/var/:rw"]
)key_path
: is a remote path for bucket containing key to be mounted
How to run
While running, you can specify the location of manifest file and the yaml file, but they are set by default to: "manifest.json" and "workflow.yaml".
import DbtWorkflowsConverter
converter = DbtWorkflowsConverter(params)
converter.convert() # writes to file workflow.yaml
To call from cli, you can
python src/dbt_workflows_converter/compile.py tests/manifest.json --image-uri xxx --region xxx --full-command xxx --remote-path xxx --key-volume-mount-path xxx --key-volume-path xxx --key-path xxx
Project Organization
- .devcontainer - This directory contains required files for creating a Codespace.
- .github
- workflows - Contains GitHub Actions used for building, testing and publishing.
- publish-test.yml - Publish wheels to https://test.pypi.org/
- publish.yml - Publish wheels to https://pypi.org/
- pull-request.yml - Build and Test pull requests before commiting to main.
- template-sync.yml - Update GitHub Repo with enhancments to base template
- workflows - Contains GitHub Actions used for building, testing and publishing.
- docs - collect documents (default format .md)
- src - place new source code here
- python_package - sample package (this can be deleted when creating a new repository)
- tests - contains Python based test cases to validation src code
- .pre-commit-config.yaml - Contains various pre-check fixes for Python
- pyproject.toml - Python Project Declaration
- ws.code-workspace - Recommended configurations for Visual Studio Code
Publish to PyPi from GitHub
In order to publish to PyPi, a repostirory secret must be created, "PYPI_PASSWORD". In order to publish to the Test PyPi, a second secret must be added, "TEST_PYPI_PASSWORD".
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
Built Distribution
Close
Hashes for dbt-workflows-factory-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3619a9af19d77c4d78eb47b9bdf9acf79bddc559471355189a597a3fbb2355 |
|
MD5 | 488449a6dbcfa13ab8c132516bb9ef34 |
|
BLAKE2b-256 | 4b92e64497a4564e1da63fd9fa2b35fdaf07027e3697dc0ccb37b43d566c00bd |
Close
Hashes for dbt_workflows_factory-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62da0cf23c59c9707e3ea5fe4c7b87dd1eca73bc4d404dac36cfbcb7c25ca734 |
|
MD5 | 43bac924309ff09b6cb05eb53271e44b |
|
BLAKE2b-256 | 5df4da2f5c8cf591e119877f128176dbb5dde58bdeef931326a1fc73aec5e38e |