Skip to content

Commit c4a1a9c

Browse files
committed
WIP
1 parent f1010ee commit c4a1a9c

File tree

3 files changed

+134
-0
lines changed

3 files changed

+134
-0
lines changed

.icons/nextflow.svg

Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
display_name: Nextflow
3+
description: A module that adds Nextflow to your Coder template.
4+
icon: ../../../../.icons/nextflow.svg
5+
verified: true
6+
tags: [nextflow, worfklow, hpc, bioinformatics]
7+
---
8+
9+
# Nextflow
10+
11+
A module that adds Nextflow to your Coder template.
12+
13+
![Nextflow](../../.images/nextflow.png)
14+
15+
```tf
16+
module "nextflow" {
17+
count = data.coder_workspace.me.start_count
18+
source = "registry.coder.com/coder/nextflow/coder"
19+
version = "0.9.0"
20+
agent_id = coder_agent.example.id
21+
}
22+
```
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
terraform {
2+
required_version = ">= 1.0"
3+
4+
required_providers {
5+
coder = {
6+
source = "coder/coder"
7+
version = ">= 2.5"
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 "nextflow_version" {
19+
type = string
20+
description = "Nextflow version"
21+
default = "25.04.7"
22+
}
23+
24+
variable "project_path" {
25+
type = string
26+
description = "The path to Nextflow project, it will be mounted in the container."
27+
}
28+
29+
variable "http_server_port" {
30+
type = number
31+
description = "The port to run HTTP server on."
32+
default = 9876
33+
}
34+
35+
variable "http_server_reports_dir" {
36+
type = number
37+
description = "Subdirectory for HTTP server reports, relative to the project path."
38+
default = "reports"
39+
}
40+
41+
variable "checkout_demos" {
42+
type = bool
43+
description = "Checkout demos?"
44+
default = false
45+
}
46+
47+
variable "stub_run" {
48+
type = bool
49+
description = "Execute a stub run?"
50+
default = false
51+
}
52+
53+
variable "stub_run_command" {
54+
type = string
55+
description = "Shell command to be executed during the stub run."
56+
default = "nextflow run . -stub-run"
57+
}
58+
59+
variable "order" {
60+
type = number
61+
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)."
62+
default = null
63+
}
64+
65+
variable "share" {
66+
type = string
67+
default = "owner"
68+
validation {
69+
condition = var.share == "owner" || var.share == "authenticated" || var.share == "public"
70+
error_message = "Incorrect value. Please set either 'owner', 'authenticated', or 'public'."
71+
}
72+
}
73+
74+
variable "group" {
75+
type = string
76+
description = "The name of a group that this app belongs to."
77+
default = null
78+
}
79+
80+
resource "coder_script" "nextflow" {
81+
agent_id = var.agent_id
82+
display_name = "nextflow"
83+
icon = "/icon/nextflow.svg"
84+
script = templatefile("${path.module}/run.sh", {
85+
NEXTFLOW_VERSION : var.nextflow_version,
86+
PROJECT_PATH : var.project_path,
87+
HTTP_SERVER_PORT : var.http_server_port,
88+
HTTP_SERVER_REPORTS_DIR : var.http_server_reports_dir,
89+
CHECKOUT_DEMOS : var.checkout_demos,
90+
STUB_RUN : var.stub_run,
91+
STUB_RUN_COMMAND : var.stub_run_command,
92+
})
93+
run_on_start = true
94+
}
95+
96+
resource "coder_app" "nextflow" {
97+
agent_id = var.agent_id
98+
slug = "nextflow-reports"
99+
display_name = "Nextflow Reports"
100+
url = "http://localhost:${var.http_server_port}"
101+
icon = "/icon/nextflow.svg"
102+
subdomain = true
103+
share = var.share
104+
order = var.order
105+
group = var.group
106+
}

0 commit comments

Comments
 (0)