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

Commit 7a8483d

Browse files
committed
Merge branch 'main' into web-rdp
2 parents ec2c8ed + 45456ab commit 7a8483d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1697
-175
lines changed

.icons/airflow.svg

Lines changed: 19 additions & 0 deletions
Loading

.icons/github.svg

Lines changed: 1 addition & 0 deletions
Loading

.images/airflow.png

603 KB
Loading

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ To create a new module, clone this repository and run:
1010

1111
A suite of test-helpers exists to run `terraform apply` on modules with variables, and test script output against containers.
1212

13+
The testing suite must be able to run docker containers with the `--network=host` flag, which typically requires running the tests on Linux as this flag does not apply to Docker Desktop for MacOS and Windows. MacOS users can work around this by using something like [colima](https://github.com/abiosoft/colima) or [Orbstack](https://orbstack.dev/) instead of Docker Desktop.
14+
1315
Reference existing `*.test.ts` files for implementation.
1416

1517
```shell

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.main.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

0 commit comments

Comments
 (0)