Skip to content

Commit

Permalink
Merge pull request #13 from shrutimantri/add-new-lines2
Browse files Browse the repository at this point in the history
feat: add new lines at appropriate places to blueprints - 3
  • Loading branch information
wrussell1999 authored Nov 8, 2024
2 parents 1d00a94 + 1f0813e commit d3f7e1f
Show file tree
Hide file tree
Showing 60 changed files with 225 additions and 237 deletions.
2 changes: 1 addition & 1 deletion cloudquery-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tasks:
url: jdbc:postgresql://host.docker.internal:5432/postgres
username: postgres
password: "{{ secret('DB_PASSWORD') }}"
fetch: true
fetchType: FETCH
sql: |
SELECT arn, region
FROM public.aws_s3_buckets
Expand Down
2 changes: 1 addition & 1 deletion copyin-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tasks:
username: postgres
password: postgres
sql: SELECT * FROM country_referential LIMIT 10
fetch: true
fetchType: FETCH

extend:
title: Load a CSV file to a Postgres table
Expand Down
2 changes: 1 addition & 1 deletion csv-duckdb-slack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tasks:
FROM
read_csv_auto('https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv',
header=True);
fetch: true
fetchType: FETCH

- id: slack
type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
Expand Down
5 changes: 3 additions & 2 deletions dbt-duckdb.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dbt-duckdb
namespace: company.team

tasks:
- id: dbt
type: io.kestra.plugin.core.flow.WorkingDirectory
Expand All @@ -8,6 +9,7 @@ tasks:
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-example
branch: main

- id: dbt_build
type: io.kestra.plugin.dbt.cli.DbtCLI
taskRunner:
Expand All @@ -26,16 +28,15 @@ tasks:
threads: 16
timeout_seconds: 300
target: dev
extend:
title: Git workflow for dbt with DuckDB
description: >
To run dbt with DuckDB, this flow does the following:
1. Clones a dbt Git repository from GitHub,
2. Pulls a public [container image with the latest package
dependencies](https://github.com/kestra-io/examples/pkgs/container/dbt-duckdb)
3. Runs dbt CLI commands in a Docker container.
tags:
- Git
Expand Down
7 changes: 3 additions & 4 deletions dbt-git-docker-duckdb.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dbt-git-docker-duckdb
namespace: company.team

tasks:
- id: dbt
type: io.kestra.plugin.core.flow.WorkingDirectory
Expand All @@ -8,6 +9,7 @@ tasks:
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-demo
branch: main

- id: dbt_core
type: io.kestra.plugin.dbt.cli.DbtCLI
taskRunner:
Expand All @@ -33,21 +35,18 @@ tasks:
commands:
- dbt deps
- dbt build

extend:
title: "Run dbt CLI commands in one container: dbt deps & dbt build"
description: >-
This flow runs multiple dbt commands in a single container.
This approach can be useful if you want to run several dbt commands and you
want to run them all in one container to minimize latency.
Firstly, the flow creates the working directory. Within the working
directory, the flow contains tasks to
1. clone the git repository
2. run the dbt commands in a docker container
tags:
- Git
Expand Down
7 changes: 3 additions & 4 deletions dbt-motherduck.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dbt-motherduck
namespace: company.team

tasks:
- id: git
type: io.kestra.plugin.core.flow.WorkingDirectory
Expand All @@ -8,6 +9,7 @@ tasks:
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-example
branch: main

- id: dbt_build
type: io.kestra.plugin.dbt.cli.DbtCLI
taskRunner:
Expand All @@ -27,19 +29,16 @@ tasks:
commands:
- dbt deps
- dbt build

extend:
title: Git workflow for dbt with MotherDuck
description: >-
This flow:
- clones a dbt Git repository from GitHub,
- pulls a public [container image with the required
dependencies](https://github.com/kestra-io/examples/pkgs/container/dbt-duckdb)
- runs dbt CLI commands in a Docker container.
To use [MotherDuck](https://motherduck.com/), use Kestra Secret to store the
[MotherDuck service
token](https://motherduck.com/docs/authenticating-to-motherduck).
Expand Down
7 changes: 3 additions & 4 deletions dbt-postgres.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dbt-postgres
namespace: company.team

tasks:
- id: git
type: io.kestra.plugin.core.flow.WorkingDirectory
Expand All @@ -8,6 +9,7 @@ tasks:
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-example
branch: main

- id: dbt
type: io.kestra.plugin.dbt.cli.DbtCLI
containerImage: ghcr.io/kestra-io/dbt-postgres:latest
Expand All @@ -28,18 +30,15 @@ tasks:
commands:
- dbt deps
- dbt build

extend:
title: Git workflow for dbt with Postgres
description: >
This flow:
- clones a dbt Git repository from GitHub
- pulls a public container image with the required dependencies
- runs dbt CLI commands in a Docker container
To run a flow from this blueprint, you can simply copy-paste the contents of
your `~/.dbt/profiles.yml` into the `profiles` section and you're good to
go!
Expand Down
8 changes: 3 additions & 5 deletions dbt-redshift.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dbt-redshift
namespace: company.team

tasks:
- id: git
type: io.kestra.plugin.core.flow.WorkingDirectory
Expand All @@ -8,6 +9,7 @@ tasks:
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-example
branch: main

- id: dbt
type: io.kestra.plugin.dbt.cli.DbtCLI
taskRunner:
Expand All @@ -31,21 +33,17 @@ tasks:
commands:
- dbt deps
- dbt build

extend:
title: Git workflow for dbt with Amazon Redshift
description: >-
This flow:
- clones a dbt Git repository from GitHub
- pulls a public container image with the required dependencies
- runs dbt CLI commands within a container
This flow assumes that your Redshift credentials are stored as secrets.
To run a flow from this blueprint, you can simply copy-paste the contents of
your `~/.dbt/profiles.yml` into the `profiles` section and you're good to
go!
Expand Down
8 changes: 3 additions & 5 deletions dbt-snowflake.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dbt-snowflake
namespace: company.team

tasks:
- id: git
type: io.kestra.plugin.core.flow.WorkingDirectory
Expand All @@ -8,6 +9,7 @@ tasks:
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/dbt-example
branch: main

- id: dbt
type: io.kestra.plugin.dbt.cli.DbtCLI
taskRunner:
Expand All @@ -33,21 +35,17 @@ tasks:
commands:
- dbt deps
- dbt build

extend:
title: Git workflow for dbt with Snowflake
description: >-
This flow:
- clones a dbt Git repository from GitHub
- pulls a public container image with the required dependencies
- runs dbt CLI commands within a container
This flow assumes that your Snowflake credentials are stored as secrets.
To run a flow from this blueprint, you can simply copy-paste the contents of
your `~/.dbt/profiles.yml` into the `profiles` section and you're good to
go!
Expand Down
22 changes: 5 additions & 17 deletions debezium-mysql-realtime-trigger.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: debezium-mysql-realtime-trigger
namespace: company.team

tasks:
- id: if
type: io.kestra.plugin.core.flow.If
Expand All @@ -9,12 +10,13 @@ tasks:
type: io.kestra.plugin.core.log.Log
message: Employee {{ trigger.data.first_name }} {{ trigger.data.last_name }} has
been deleted

- id: send_alert
type: io.kestra.plugin.notifications.slack.SlackExecution
url: "{{ secret('SLACK_WEBHOOK') }}"
channel: "#general"
customMessage: Employee {{ trigger.data.first_name }} {{ trigger.data.last_name
}} has been deleted
customMessage: Employee {{ trigger.data.first_name }} {{ trigger.data.last_name }} has been deleted

triggers:
- id: realtime_trigger
type: io.kestra.plugin.debezium.mysql.RealtimeTrigger
Expand All @@ -25,20 +27,19 @@ triggers:
port: "13306"
username: mysql_username
password: mysql_password

extend:
title: Use Debezium MySQL Realtime Trigger to send out alert notification over Slack
description: >-
This flow will:
1. Get
[triggered](https://kestra.io/plugins/plugin-debezium/triggers/io.kestra.plugin.debezium.mysql.realtimetrigger)
every time the change data capture event is produced by the MySQL
2. If there is a DELETE operation on the table, we would log the employee
name that was deleted, and also send out a Slack notificaiton
For creating a MySQL cluster, use the following docker command:
```
Expand All @@ -54,40 +55,27 @@ extend:
--binlog_do_db=test
```
This docker command puts in the necessary configuration to enable the
binlog.
Run the following commands on the MySQL:
```
GRANT REPLICATION SLAVE ON *.* TO 'root'@'%';
# Check if the binlog is enabled
SHOW VARIABLES LIKE 'log_bin';
```
You can now create the `test` database and the `employees` table in MySQL.
```
CREATE DATABASE test;
CREATE TABLE test.employees (id INT, first_name VARCAHR(25), last_name
VARCAHR(25), city VARCAHR(25));
```
When you insert, update or delete data into test.employees table, the flow
will be triggered immediately. Only in case of delete operation, we will log
the message and send out a Slack notification.
Expand Down
4 changes: 3 additions & 1 deletion discord-alert.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: discord-alert
namespace: company.team

tasks:
- id: send_discord_message
type: io.kestra.plugin.notifications.discord.DiscordExecution
Expand All @@ -12,6 +13,7 @@ tasks:
- 255
- 255
executionId: "{{ trigger.executionId }}"

triggers:
- id: failed_prod_workflows
type: io.kestra.plugin.core.trigger.Flow
Expand All @@ -23,6 +25,7 @@ triggers:
- type: io.kestra.plugin.core.condition.ExecutionNamespaceCondition
namespace: company.analytics
prefix: true

extend:
title: Send a Discord message when a production workflow fails
description: >-
Expand All @@ -34,7 +37,6 @@ extend:
Kestra will make sure that all executions matching the conditions will
receive notifications.
To use this flow, you need to create a Discord webhook and store it as a
Secret. Follow this [guide on
Discord](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
Expand Down
3 changes: 3 additions & 0 deletions dlt-elt-chess-api-to-duckdb.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
id: dlt-elt-chess-api-to-duckdb
namespace: company.team

tasks:
- id: chess_api_to_duckdb
type: io.kestra.plugin.scripts.python.Script
Expand All @@ -25,11 +26,13 @@ tasks:
data.append(response.json())
# Extract, normalize, and load the data
pipeline.run(data, table_name='player')
triggers:
- id: daily
type: io.kestra.plugin.core.trigger.Schedule
disabled: true
cron: 0 9 * * *

extend:
title: Schedule a Python data ingestion job to extract data from an API and load
it to DuckDB using dltHub (data load tool)
Expand Down
Loading

0 comments on commit d3f7e1f

Please sign in to comment.