Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit c36f4e0

Browse files
authored
Merge pull request #1 from coder/main
Merge from original
2 parents ed16ba5 + 443485a commit c36f4e0

File tree

25 files changed

+1011
-65
lines changed

25 files changed

+1011
-65
lines changed

.icons/airflow.svg

Lines changed: 19 additions & 0 deletions
Loading

.images/airflow.png

603 KB
Loading

apache-airflow/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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: coder
6+
partner_github: nataindata
7+
verified: true
8+
tags: [airflow, idea, web, helper]
9+
---
10+
11+
# airflow
12+
13+
A module that adds Apache Airflow in your Coder template.
14+
15+
```tf
16+
module "airflow" {
17+
source = "registry.coder.com/modules/apache-airflow/coder"
18+
version = "1.0.13"
19+
agent_id = coder_agent.example.id
20+
}
21+
```
22+
23+
![Airflow](../.images/airflow.png)

apache-airflow/main.tf

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
}

apache-airflow/run.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 [email protected] -f Coder -l User

aws-region/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Customize the preselected parameter value:
1717
```tf
1818
module "aws-region" {
1919
source = "registry.coder.com/modules/aws-region/coder"
20-
version = "1.0.10"
20+
version = "1.0.12"
2121
default = "us-east-1"
2222
}
2323
@@ -37,7 +37,7 @@ Change the display name and icon for a region using the corresponding maps:
3737
```tf
3838
module "aws-region" {
3939
source = "registry.coder.com/modules/aws-region/coder"
40-
version = "1.0.10"
40+
version = "1.0.12"
4141
default = "ap-south-1"
4242
4343
custom_names = {
@@ -63,7 +63,7 @@ Hide the Asia Pacific regions Seoul and Osaka:
6363
```tf
6464
module "aws-region" {
6565
source = "registry.coder.com/modules/aws-region/coder"
66-
version = "1.0.10"
66+
version = "1.0.12"
6767
exclude = ["ap-northeast-2", "ap-northeast-3"]
6868
}
6969

azure-region/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This module adds a parameter with all Azure regions, allowing developers to sele
1414
```tf
1515
module "azure_region" {
1616
source = "registry.coder.com/modules/azure-region/coder"
17-
version = "1.0.2"
17+
version = "1.0.12"
1818
default = "eastus"
1919
}
2020
@@ -34,7 +34,7 @@ Change the display name and icon for a region using the corresponding maps:
3434
```tf
3535
module "azure-region" {
3636
source = "registry.coder.com/modules/azure-region/coder"
37-
version = "1.0.2"
37+
version = "1.0.12"
3838
custom_names = {
3939
"australia" : "Go Australia!"
4040
}
@@ -57,7 +57,7 @@ Hide all regions in Australia except australiacentral:
5757
```tf
5858
module "azure-region" {
5959
source = "registry.coder.com/modules/azure-region/coder"
60-
version = "1.0.2"
60+
version = "1.0.12"
6161
exclude = [
6262
"australia",
6363
"australiacentral2",

0 commit comments

Comments
 (0)