Prophecy-build-tool (PBT) provides utilities to build and distribute projects created from the Prophecy IDE.
Project description
prophecy-build-tool
Prophecy is designed to enable all users to be productive with data engineering. It also replaces legacy ETL products. To learn more about Prophecy visit https://docs.prophecy.io/.
Prophecy-build-tool (PBT) allows you to quickly build projects generated by Prophecy (your standard Spark Scala and PySpark pipelines) to integrate them with your own CI / CD (e.g. Github Actions), build system (e.g. Jenkins), and orchestration (e.g. Databricks Workflows).
For the latest information on how to use Prophecy-build-tool please visit https://docs.prophecy.io/metadata/prophecy-build-tool.
Installation
To install PBT, simply run:
pip3 install prophecy-build-tool
Running
To build and deploy your Prophecy project containing Python/Scala projects and Databricks Jobs run
pbt deploy --path /path/to/your/prophecy_project/
Sample output:
Prophecy-build-tool v1.0.0
Found 1 pipelines: customers_orders (python)
Found 1 jobs: daily_report
Building 1 pipeline 🚰
Building pipeline pipelines/customers_orders [1/1]
running build
running build_py
✅ Build complete!
Deploying 1 job ⏱
Deploying job jobs/daily_report [1/1]
Uploading cs-1.0-py3-none-any.whl to dbfs:/FileStore/prophecy/artifacts/...
Updating an existing job: daily_report
✅ Deployment complete!
To just build your Prophecy project containing Python/Scala projects and Databricks Jobs run
pbt build --path /path/to/your/prophecy_project/
To run all unit tests in your Prophecy project containing Python/Scala projects and Databricks Jobs run
pbt test --path /path/to/your/prophecy_project/
Sample output:
Prophecy-build-tool v1.0.1
Found 1 jobs: daily
Found 1 pipelines: customers_orders (python)
Unit Testing pipeline pipelines/customers_orders [1/1]
============================= test session starts ==============================
platform darwin -- Python 3.8.9, pytest-7.1.2, pluggy-1.0.0 -- /Library/Developer/CommandLineTools/usr/bin/python
cachedir: .pytest_cache
metadata: None
rootdir: /Users/kiran/proj2/pipelines/customers_orders/code
plugins: html-3.1.1, metadata-2.0.2
collecting ... collected 1 item
test/TestSuite.py::CleanupTest::test_unit_test_0 PASSED [100%]
============================== 1 passed in 17.42s ==============================
✅ Unit test for pipeline: pipelines/customers_orders succeeded.
Integrating with Github actions
Prophecy-built-tool (PBT) can be integrated with CI/CD (eg: Github Actions). A sample Github Actions .yml file that builds, tests and deploys the project on every code push is mentioned below:
name: Example CI
on: [push]
env:
DATABRICKS_HOST: "https://<<databricks-host>>.databricks.com"
DATABRICKS_TOKEN: "<<databricks-token>>"
FABRIC_NAME: "fabric-name"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Install all python dependencies
# prophecy-libs not included here because prophecy-build-tool
# takes care of it by reading each pipeline's setup.py
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install build pytest wheel pytest-html pyspark prophecy-build-tool
- name: Run PBT build
run: pbt build --path .
- name: Run PBT test
run: pbt test --path .
- name: Run PBT deploy
run: pbt deploy --path .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for prophecy-build-tool-1.0.3.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | acf058e690fa29336e32c69edf3ef8c8139daa61e59783c5257f3eb3f1a579b1 |
|
MD5 | 4158e2f105853b1b865fef01fef23759 |
|
BLAKE2b-256 | 27e8e1be66adc1320f30bd054f1b17fe0eb7a9bde8b46fba8cc35aaed11f32b8 |
Hashes for prophecy_build_tool-1.0.3.4-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95e4b2401cd351dc881877980df6382326204931e74e01a1e69953cd06a56965 |
|
MD5 | 319dd7afb90ee9f5bb6ecc8b9100f011 |
|
BLAKE2b-256 | adcc4eeea1f0be2fc1de92d15972790d5565979e5b99ac880a1268b60b3d0486 |
Hashes for prophecy_build_tool-1.0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5135e8c41622d82cef8b8e41e87dfd7917fc4cc64665917dca08ecbc3a9a4fda |
|
MD5 | 9b15ee739d21dfe8ded2d40b8442179f |
|
BLAKE2b-256 | 9a1349986ba3b706474b6abfe8684b5121eef97caa17b59083b20b7f1602eea8 |