Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit 8c8c046

Browse files
adwk67sbernauer
andcommitted
Airflow cron-DAG demo (#115)
## Description A simple Airflow demo showing how to import/load a custom DAG and schedule it by enabling and triggering it. Co-authored-by: Sebastian Bernauer <[email protected]>
1 parent 99b52fe commit 8c8c046

File tree

16 files changed

+163
-3
lines changed

16 files changed

+163
-3
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: start-dag-job
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: start-dag-job
11+
image: docker.stackable.tech/stackable/testing-tools:0.1.0-stackable0.1.0
12+
command: ["bash", "-c", "
13+
curl -s --user airflow:airflow -H 'Content-Type:application/json' -XPATCH http://airflow-webserver-default:8080/api/v1/dags/date_demo -d '{\"is_paused\": false}'
14+
&& curl -s --user airflow:airflow -H 'Content-Type:application/json' -XPOST http://airflow-webserver-default:8080/api/v1/dags/date_demo/dagRuns -d '{}'
15+
"]
16+
restartPolicy: OnFailure
17+
backoffLimit: 20 # give some time for the Airflow cluster to be available

demos/demos-v1.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@ demos:
5555
manifests:
5656
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/hbase-hdfs-load-cycling-data/01-distcp-cycling-data.yaml
5757
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/hbase-hdfs-load-cycling-data/02-create-hfile-and-import-to-hbase.yaml
58+
airflow-scheduled-job:
59+
description: Activate a simple Airflow DAG to run continously at a set interval
60+
stackableStack: airflow
61+
labels:
62+
- airflow
63+
- job-scheduling
64+
manifests:
65+
- plainYaml: https://raw.githubusercontent.com/stackabletech/stackablectl/main/demos/airflow-scheduled-job/enable-and-run-dag.yaml
51.5 KB
Loading
160 KB
Loading
114 KB
Loading
51.9 KB
Loading
38.8 KB
Loading
240 KB
Loading
142 KB
Loading
12.7 KB
Loading

0 commit comments

Comments
 (0)