Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3776589
D3281.id8442.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D3281.id8442.diff
View Options
diff --git a/pillar/saas/airflow.sls b/pillar/saas/airflow.sls
new file mode 100644
--- /dev/null
+++ b/pillar/saas/airflow.sls
@@ -0,0 +1,27 @@
+# -------------------------------------------------------------
+# Salt — Airflow
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Airflow DAGs composition
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+airflow_pipelines:
+
+ # Realm: nasqueron
+
+ nasqueron:
+
+ datasources:
+ source:
+ # DAGs currently living in test branch - D2754
+ repository: https://devcentral.nasqueron.org/source/datasources.git
+ ref: pipeline
+ directory: _pipelines/dags
+
+ python_dependencies:
+ - requests
+
diff --git a/pillar/top.sls b/pillar/top.sls
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -45,6 +45,7 @@
dwellers:
- paas.docker
+ - saas.airflow
- saas.jenkins
eglide:
diff --git a/roles/saas-airflow/dags/init.sls b/roles/saas-airflow/dags/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/saas-airflow/dags/init.sls
@@ -0,0 +1,35 @@
+# -------------------------------------------------------------
+# Salt — Airflow
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Airflow DAGs composition
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for realm, dags_to_import in pillar.get("airflow_pipelines", {}).items() %}
+
+/srv/airflow/{{ realm }}/src:
+ file.directory
+
+{% for name, args in dags_to_import.items() %}
+
+{% set rev = args.get("ref", "main") %}
+{% set directory = args.get("directory", "") %}
+
+airflow_dags_{{ realm }}_{{ name }}_repo:
+ git.latest:
+ - name: {{ args["repository"] }}
+ - target: /srv/airflow/{{ realm }}/src/{{ name }}
+ - rev: {{ rev }}
+
+airflow_dags_{{ realm }}_{{ name }}:
+ file.copy:
+ - name: /srv/airflow/{{ realm }}/dags
+ - source: /srv/airflow/{{ realm }}/src/{{ name }}/{{ directory }}
+ - user: 50000
+
+{% endfor %}
+{% endfor %}
diff --git a/roles/saas-airflow/init.sls b/roles/saas-airflow/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/saas-airflow/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — Airflow
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .dags
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -39,6 +39,7 @@
'dwellers':
- roles/paas-docker/docker
- roles/paas-lxc/lxc
+ - roles/saas-airflow
'eglide':
- roles/webserver-core
- roles/shellserver
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 22:54 (6 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263411
Default Alt Text
D3281.id8442.diff (3 KB)
Attached To
Mode
D3281: Provision Airflow DAGs folders
Attached
Detach File
Event Timeline
Log In to Comment