Skip to content

Commit

Permalink
fix: blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-geller committed Dec 3, 2024
1 parent fac8321 commit a7392c2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
26 changes: 7 additions & 19 deletions business-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ tasks:
- id: working_directory
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: create_table
type: io.kestra.plugin.jdbc.sqlite.Query
- id: query
type: io.kestra.plugin.jdbc.sqlite.Queries
url: jdbc:sqlite:kestra.db
fetchType: STORE
sql: |
CREATE TABLE IF NOT EXISTS features (
id INTEGER PRIMARY KEY,
Expand All @@ -18,39 +19,26 @@ tasks:
edition TEXT NOT NULL
);
- id: empty_table
type: io.kestra.plugin.jdbc.sqlite.Query
url: jdbc:sqlite:kestra.db
sql: DELETE FROM features;
DELETE FROM features;
- id: insert_data
type: io.kestra.plugin.jdbc.sqlite.Query
url: jdbc:sqlite:kestra.db
sql: >
INSERT INTO features (name, description, release_version, edition)
VALUES
('Worker Groups', 'Allows targeting specific tasks or triggers to run on specific remote workers for better scalability and resource management.', '0.10', 'Enterprise'),
('Realtime Triggers', 'Supports triggering event-driven workflows in real-time.', '0.17', 'Open-Source'),
('Task Runners', 'Provides on-demand remote execution environments for running tasks.', '0.16', 'Open-Source'),
('KV Store', 'Adds key-value storage for persisting data across workflow executions.', '0.18', 'Open-Source'),
('SCIM Directory Sync', 'Allows synchronization of users and groups from Identity Providers.', '0.18', 'Enterprise');
- id: query
type: io.kestra.plugin.jdbc.sqlite.Query
url: jdbc:sqlite:kestra.db
fetchType: STORE
sql: |
SELECT * FROM features
ORDER BY release_version;
- id: to_csv
type: io.kestra.plugin.serdes.csv.IonToCsv
from: "{{ outputs.query.uri }}"
from: "{{ outputs.query.outputs[0].uri }}"

- id: to_excel
type: io.kestra.plugin.serdes.excel.IonToExcel
from: "{{ outputs.query.uri }}"
from: "{{ outputs.query.outputs[0].uri }}"

extend:
title: Getting started with Kestra — a Business Automation workflow example
Expand Down
5 changes: 2 additions & 3 deletions dwh-and-analytics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ tasks:
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
containerImage: ghcr.io/kestra-io/duckdb:latest
script: >
script: |
import duckdb
import pandas as pd
conn = duckdb.connect(database='dbt.duckdb', read_only=False)
tables_query = "SELECT table_name FROM information_schema.tables WHERE
table_schema = 'main';"
tables_query = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'main';"
tables = conn.execute(tables_query).fetchall()
Expand Down
6 changes: 3 additions & 3 deletions infrastructure-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ tasks:
RUN pip install --no-cache-dir kestra
tags:
- "{{ inputs.docker_image }}"
push: false
push: false # you can change this to true after adding credentials
credentials:
registry: https://index.docker.io/v1/
username: "{{ secret('DOCKERHUB_USERNAME') }}"
password: "{{ secret('DOCKERHUB_PASSWORD') }}"

- id: run_container
type: io.kestra.plugin.docker.Run
pullPolicy: NEVER
pullPolicy: NEVER # to use the local image we've just built
containerImage: "{{ inputs.docker_image }}"
commands:
- pip
Expand All @@ -40,7 +40,7 @@ tasks:
outputFiles:
- "*.txt"
inputFiles:
main.tf: >
main.tf: |
terraform {
required_providers {
http = {
Expand Down

0 comments on commit a7392c2

Please sign in to comment.