File tree 5 files changed +172
-0
lines changed
5 files changed +172
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ display_name : airflow
3
+ description : A module that adds Apache Airflow in your Coder template
4
+ icon : ../.icons/airflow.svg
5
+ maintainer_github : nataindata
6
+ verified : false
7
+ tags : [airflow, idea, web, helper]
8
+ ---
9
+
10
+ # airflow
11
+
12
+ A module that adds Apache Airflow in your Coder template.
13
+
14
+ ``` tf
15
+ module "airflow" {
16
+ source = "registry.coder.com/modules/airflow/coder"
17
+ version = "1.0.2"
18
+ }
19
+ ```
20
+
21
+ ![ Airflow] ( ../.images/airflow.png )
22
+
23
+ ## Examples
24
+
25
+ ### Example 1
26
+
27
+ Install the Dracula theme from [ OpenVSX] ( https://open-vsx.org/ ) :
28
+
29
+ ``` tf
30
+ module "airflow" {
31
+ source = "registry.coder.com/modules/airflow/coder"
32
+ version = "1.0.2"
33
+ agent_id = coder_agent.example.id
34
+ extensions = [
35
+ "dracula-theme.theme-dracula"
36
+ ]
37
+ }
38
+ ```
39
+
40
+ Enter the ` <author>.<name> ` into the extensions array and code-server will automatically install on start.
41
+
42
+ ### Example 2
43
+
44
+ Configure VS Code's [ settings.json] ( https://code.visualstudio.com/docs/getstarted/settings#_settingsjson ) file:
45
+
46
+ ``` tf
47
+ module "airflow" {
48
+ source = "registry.coder.com/modules/airflow/coder"
49
+ version = "1.0.2"
50
+ agent_id = coder_agent.example.id
51
+ extensions = ["dracula-theme.theme-dracula"]
52
+ settings = {
53
+ "workbench.colorTheme" = "Dracula"
54
+ }
55
+ }
56
+ ```
57
+
58
+ ### Example 3
59
+
60
+ Run code-server in the background, don't fetch it from GitHub:
61
+
62
+ ``` tf
63
+ module "airflow" {
64
+ source = "registry.coder.com/modules/airflow/coder"
65
+ version = "1.0.2"
66
+ agent_id = coder_agent.example.id
67
+ offline = true
68
+ }
69
+ ```
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_version = " >= 1.0"
3
+
4
+ required_providers {
5
+ coder = {
6
+ source = " coder/coder"
7
+ version = " >= 0.17"
8
+ }
9
+ }
10
+ }
11
+
12
+ # Add required variables for your modules and remove any unneeded variables
13
+ variable "agent_id" {
14
+ type = string
15
+ description = " The ID of a Coder agent."
16
+ }
17
+
18
+ variable "log_path" {
19
+ type = string
20
+ description = " The path to log airflow to."
21
+ default = " /tmp/airflow.log"
22
+ }
23
+
24
+ variable "port" {
25
+ type = number
26
+ description = " The port to run airflow on."
27
+ default = 8080
28
+ }
29
+
30
+ variable "share" {
31
+ type = string
32
+ default = " owner"
33
+ validation {
34
+ condition = var. share == " owner" || var. share == " authenticated" || var. share == " public"
35
+ error_message = " Incorrect value. Please set either 'owner', 'authenticated', or 'public'."
36
+ }
37
+ }
38
+
39
+ variable "order" {
40
+ type = number
41
+ description = " The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order)."
42
+ default = null
43
+ }
44
+
45
+ resource "coder_script" "airflow" {
46
+ agent_id = var. agent_id
47
+ display_name = " airflow"
48
+ icon = " /icon/apache-guacamole.svg"
49
+ script = templatefile (" ${ path . module } /run.sh" , {
50
+ LOG_PATH : var.log_path,
51
+ PORT : var.port
52
+ })
53
+ run_on_start = true
54
+ }
55
+
56
+ resource "coder_app" "airflow" {
57
+ agent_id = var. agent_id
58
+ slug = " airflow"
59
+ display_name = " airflow"
60
+ url = " http://localhost:${ var . port } "
61
+ icon = " /icon/apache-guacamole.svg"
62
+ subdomain = true
63
+ share = var. share
64
+ order = var. order
65
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ BOLD=' \033[0;1m'
4
+
5
+ PATH=$PATH :~ /.local/bin
6
+ pip install --upgrade apache-airflow
7
+
8
+ filename=~ /airflow/airflow.db
9
+ if ! [ -f $filename ] || ! [ -s $filename ]; then
10
+ airflow db init
11
+ fi
12
+
13
+ export AIRFLOW__CORE__LOAD_EXAMPLES=false
14
+
15
+ airflow webserver > ${LOG_PATH} 2>&1 &
16
+
17
+ airflow scheduler >> /tmp/airflow_scheduler.log 2>&1 &
18
+
19
+ airflow users create -u admin -p admin -r Admin -e admin@admin.com -f Coder -l User
You can’t perform that action at this time.
0 commit comments