Skip to content

Commit 120af29

Browse files
committed
Add Seqera Studios custom image
1 parent acd83c1 commit 120af29

File tree

6 files changed

+859
-10
lines changed

6 files changed

+859
-10
lines changed

README.md

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,64 @@ Gives new Node-RED node types for your automation workflows, which are designed
2121

2222
Also [Launch](#launch) and [Workflow](#workflow) nodes for more custom workflows where polling workflow status is not required and it's helpful to have full control.
2323

24+
# Typical Use cases
25+
26+
- Integration with events _coming from_ and _going to_ third-party services (AWS, Slack, and [>5000 others](https://flows.nodered.org/search?type=node) supported by Node-RED)
27+
- Link triggers and actions to build automation logic using a graphical builder
28+
- Chain workflows, launching downstream automatically
29+
- (Bonus) Use with [Home Assistant](https://community.home-assistant.io/t/home-assistant-community-add-on-node-red/55023) to make your office lights go into disco mode when a pipeline completes 🪩 🕺🏻 🎉
30+
2431
# Installation
2532

33+
## Within Node-RED
34+
35+
_File_ > _Manage Palette_, then the _Install_ tab.
36+
Search for `@seqera/node-red-seqera` (or just "seqera") and you
37+
should find this package. Click _Install_ and the nodes will be available.
38+
39+
## Via the command line
40+
2641
Install via the Node-RED palette manager _or_ from the command line inside your Node-RED user directory (`~/.node-red`):
2742

2843
```bash
2944
npm install @seqera/node-red-seqera
3045
```
3146

32-
Once installed, example flows are available in the Node-RED import menu under `Import > Examples > @seqera/node-red-seqera`.
47+
## Seqera Studios
3348

34-
# Use cases
49+
This repository comes with a custom Docker image containing botth Node-RED and the Seqera nodes, designed to run within
50+
[Seqera Studios](https://docs.seqera.io/platform-cloud/studios/overview).
3551

36-
- Integration with events _coming from_ and _going to_ third-party services (AWS, Slack, and [>5000 others](https://flows.nodered.org/search?type=node))
37-
- Stack events and build automation logic using a graphical builder
38-
- Chain workflows, launching downstream automatically
39-
- Use with [Home Assistant](https://community.home-assistant.io/t/home-assistant-community-add-on-node-red/55023) to make your office lights go into disco mode when a pipeline completes 🪩 🕺🏻 🎉
52+
Simply create a new Studio with the _Template_ set to _Prebuilt container image_ and enter `ewels/node-red-data-studios:latest`.
53+
Make sure that the studio is set to _Always keep the session running_.
54+
55+
Your new Studio should launch with a complete Node-RED instance that's ready for you to customise and use with Seqera automation.
56+
57+
> [!NOTE]
58+
> This image is designed to be a reference only to get you started only.
59+
> For production usage, please customise the `studios-template/Dockerfile` and `studios-template/settings.js` files
60+
> to meet your security and usage requirements.
61+
62+
## Example Flows
63+
64+
Once installed, example flows are available in the Node-RED import menu under _Import_ > _Examples_ > _@seqera/node-red-seqera_.
4065

4166
# Usage
4267

4368
## Seqera Config Node
4469

4570
Create a Seqera Config node to store your API credentials and default settings.
4671

72+
This is used by all other Seqera Node-RED nodes, so that you only
73+
have to enter your Seqera credentials once.
74+
4775
- **Base URL**: The base URL for the Seqera API (default: https://api.cloud.seqera.io)
4876
- **Workspace ID**: Your Seqera workspace ID
49-
- **Token**: Your Seqera API token
77+
- **Token**: Your Seqera API token. Create a Seqera access token via [_Your Tokens_](https://cloud.seqera.io/tokens) in the user menu.
5078

5179
## Create Dataset
5280

53-
Creates a new dataset and uploads its file contents in one step.
81+
Creates a new Dataset and uploads its file contents in one step.
5482

5583
### Inputs
5684

@@ -75,9 +103,9 @@ Launches a workflow and then periodically checks its status until completion.
75103

76104
### Inputs
77105

78-
- `pollInterval`: How frequently to check workflow status (in seconds)
79106
- `launchpadName`: The Human-readable name of a pipeline in the launchpad to use
80107
- `params`: JSON object containing parameters to merge with the launchpad's default parameters
108+
- `pollInterval`: How frequently to check workflow status (in seconds)
81109
- `workspaceId`: Override the workspace ID from the \* config node
82110
- `sourceWorkspaceId`: The source workspace ID (if a shared workflow and different to workspaceId)
83111

nodes/seqera-config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
- **Base URL**: The base URL for the Seqera API (defaults to `https://api.cloud.seqera.io`)
2424
- **Workspace ID**: Your Seqera workspace ID (optional)
25-
- **API Token**: Your personal access token for authenticating with Seqera Platform
25+
- **API Token**: Your personal access token for authenticating with Seqera Platform. Create a Seqera access token via [_Your Tokens_](https://cloud.seqera.io/tokens) in the user menu.
2626

2727
This configuration node is used by all other Seqera nodes to authenticate with the Seqera Platform API.
2828

studios-template/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Build command. NB: RUN FROM REPO ROOT DIR!
2+
# docker build . -f studios-template/Dockerfile -t ewels/node-red-data-studios:latest --platform linux/amd64
3+
# docker push ewels/node-red-data-studios:latest
4+
5+
# Stage 1: Get the Seqera Connect client
6+
FROM public.cr.seqera.io/platform/connect-client:0.8 AS connect
7+
8+
# Final image: Start from the official node-red image
9+
FROM nodered/node-red:latest-debian
10+
11+
USER root
12+
13+
# Install extra dependencies and tools
14+
RUN apt-get update && apt-get install -y \
15+
wget \
16+
ca-certificates \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Copy Connect binary and install dependencies
20+
COPY --from=connect /usr/bin/connect-client /usr/bin/connect-client
21+
RUN /usr/bin/connect-client --install
22+
23+
# Set connect as the entrypoint
24+
ENTRYPOINT ["/usr/bin/connect-client", "--entrypoint"]
25+
26+
# Copy package.json to the WORKDIR so npm builds all of your added nodes modules
27+
WORKDIR /node-red-data
28+
COPY ./studios-template/package.json /node-red-data
29+
RUN npm install --unsafe-perm --no-update-notifier --no-fund --only=production
30+
31+
# Copy _your_ Node-RED project files into place
32+
COPY ./studios-template/settings.js /node-red-data/settings.js
33+
COPY ./examples/create_launch_monitor.json /node-red-data/flows.json
34+
35+
# Default command to run node-red
36+
ENV LAST_MODIFIED="2025-05-16-01:55"
37+
CMD ["/bin/bash", "-c", "node-red --userDir /node-red-data --port $CONNECT_TOOL_PORT"]

studios-template/flows.json

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
[
2+
{
3+
"id": "5ddebd1124f2b1c0",
4+
"type": "tab",
5+
"label": "Create dataset, launch + monitor",
6+
"disabled": false,
7+
"info": "# Create dataset, launch + monitor\n\nThis example demonstrates a typical workflow to create a new dataset in Seqera Platform, then use it to launch and monitor a workflow. These nodes could typically be combined with 3rd party integrations.\n\n1. Configure the Seqera Platform connection with your API token\n2. Edit the example node parameters\n3. Launch the workflow and monitor its execution",
8+
"env": []
9+
},
10+
{
11+
"id": "841b1de7f2520e91",
12+
"type": "seqera-launch-monitor",
13+
"z": "5ddebd1124f2b1c0",
14+
"name": "nf-core/fetchngs",
15+
"seqera": "",
16+
"poll": "5",
17+
"pollType": "num",
18+
"launchpadName": "nf-core-fetchngs2",
19+
"launchpadNameType": "str",
20+
"paramsKey": "{\t \"outdir\":\"s3://nf-core-awsmegatests/node-red-tests/\" & $flowContext(\"myRunName\") & \"/fetchngs/results\",\t \"nf_core_pipeline\":\"rnaseq\",\t \"input\": payload.version.url\t}",
21+
"paramsKeyType": "jsonata",
22+
"workspaceId": "",
23+
"workspaceIdType": "str",
24+
"sourceWorkspaceId": "",
25+
"sourceWorkspaceIdType": "str",
26+
"x": 230,
27+
"y": 380,
28+
"wires": [[], ["5208d2bb907ddbf3"], ["23ee14a8fa7d2bc5"]]
29+
},
30+
{
31+
"id": "af2c2073b4781f2c",
32+
"type": "inject",
33+
"z": "5ddebd1124f2b1c0",
34+
"name": "Trigger launch",
35+
"props": [
36+
{
37+
"p": "topic",
38+
"vt": "str"
39+
}
40+
],
41+
"repeat": "",
42+
"crontab": "",
43+
"once": false,
44+
"onceDelay": 0.1,
45+
"topic": "",
46+
"x": 130,
47+
"y": 300,
48+
"wires": [["f1a41db5a7ed8618"]]
49+
},
50+
{
51+
"id": "f1a41db5a7ed8618",
52+
"type": "seqera-dataset-create",
53+
"z": "5ddebd1124f2b1c0",
54+
"name": "",
55+
"seqera": "",
56+
"datasetName": "myRunName",
57+
"datasetNameType": "flow",
58+
"fileContents": "\"SRR3192657\\nSRR3192658\\nSRR3192408\\nSRR3192409\"",
59+
"fileContentsType": "json",
60+
"workspaceId": "",
61+
"workspaceIdType": "str",
62+
"description": "A test dataset containing some SRA ids for fetchngs to download",
63+
"descriptionType": "str",
64+
"fileType": "csv",
65+
"x": 300,
66+
"y": 300,
67+
"wires": [["841b1de7f2520e91"]]
68+
},
69+
{
70+
"id": "5208d2bb907ddbf3",
71+
"type": "seqera-launch-monitor",
72+
"z": "5ddebd1124f2b1c0",
73+
"name": "nf-core/rnaseq",
74+
"seqera": "",
75+
"poll": "5",
76+
"pollType": "num",
77+
"launchpadName": " nf-core-rnaseq",
78+
"launchpadNameType": "str",
79+
"paramsKey": "{\t \"input\": \"s3://nf-core-awsmegatests/node-red-tests/\" & $flowContext(\"myRunName\") & \"/fetchngs/results/samplesheet/samplesheet.csv\",\t \"outdir\": \"s3://nf-core-awsmegatests/node-red-tests/\" & $flowContext(\"myRunName\") & \"/rnaseq/results\",\t \"genome\": \"GRCh37\",\t \"skip_alignment\": true\t}",
80+
"paramsKeyType": "jsonata",
81+
"workspaceId": "",
82+
"workspaceIdType": "str",
83+
"sourceWorkspaceId": "",
84+
"sourceWorkspaceIdType": "str",
85+
"x": 440,
86+
"y": 380,
87+
"wires": [[], ["db48fac27ee50dbf"], ["13e5309682b3f6e2"]]
88+
},
89+
{
90+
"id": "77c70ff42938bde1",
91+
"type": "change",
92+
"z": "5ddebd1124f2b1c0",
93+
"name": "Set flow.myRunName",
94+
"rules": [
95+
{
96+
"t": "set",
97+
"p": "myRunName",
98+
"pt": "flow",
99+
"to": "test-2025-05-07-v2",
100+
"tot": "str"
101+
}
102+
],
103+
"action": "",
104+
"property": "",
105+
"from": "",
106+
"to": "",
107+
"reg": false,
108+
"x": 420,
109+
"y": 160,
110+
"wires": [[]]
111+
},
112+
{
113+
"id": "388cfb48567a7421",
114+
"type": "inject",
115+
"z": "5ddebd1124f2b1c0",
116+
"name": "Trigger: Set dataset name",
117+
"props": [
118+
{
119+
"p": "topic",
120+
"vt": "str"
121+
}
122+
],
123+
"repeat": "",
124+
"crontab": "",
125+
"once": false,
126+
"onceDelay": 0.1,
127+
"topic": "",
128+
"x": 170,
129+
"y": 160,
130+
"wires": [["77c70ff42938bde1"]]
131+
},
132+
{
133+
"id": "13e5309682b3f6e2",
134+
"type": "debug",
135+
"z": "5ddebd1124f2b1c0",
136+
"name": "Workflow 2 - Fail",
137+
"active": true,
138+
"tosidebar": true,
139+
"console": false,
140+
"tostatus": false,
141+
"complete": "payload",
142+
"targetType": "msg",
143+
"statusVal": "",
144+
"statusType": "auto",
145+
"x": 670,
146+
"y": 400,
147+
"wires": []
148+
},
149+
{
150+
"id": "db48fac27ee50dbf",
151+
"type": "debug",
152+
"z": "5ddebd1124f2b1c0",
153+
"name": "Workflow 2 - Success",
154+
"active": true,
155+
"tosidebar": true,
156+
"console": false,
157+
"tostatus": false,
158+
"complete": "payload",
159+
"targetType": "msg",
160+
"statusVal": "",
161+
"statusType": "auto",
162+
"x": 680,
163+
"y": 360,
164+
"wires": []
165+
},
166+
{
167+
"id": "23ee14a8fa7d2bc5",
168+
"type": "debug",
169+
"z": "5ddebd1124f2b1c0",
170+
"name": "Workflow 1 - Fail",
171+
"active": true,
172+
"tosidebar": true,
173+
"console": false,
174+
"tostatus": false,
175+
"complete": "payload",
176+
"targetType": "msg",
177+
"statusVal": "",
178+
"statusType": "auto",
179+
"x": 470,
180+
"y": 460,
181+
"wires": []
182+
},
183+
{
184+
"id": "e2ad316cb81a7c7e",
185+
"type": "comment",
186+
"z": "5ddebd1124f2b1c0",
187+
"name": "Run name",
188+
"info": "Each pipeline run on Seqera Platform ideally\nneeds a unique name to identify it.\n\nIn this workflow, we assign a run name to a\nNode-RED `flow` variable so that we can easily\nreuse it in multiple input locations.\n\nThis node simply sets that variable to a\nfixed string, which you can edit.\nClick the trigger to set.\n\nIn reality you would likely set this variable\ndynamically, according to your automation inputs.",
189+
"x": 420,
190+
"y": 120,
191+
"wires": []
192+
},
193+
{
194+
"id": "764c19dff8978702",
195+
"type": "comment",
196+
"z": "5ddebd1124f2b1c0",
197+
"name": "Datasets",
198+
"info": "Seqera Platform has something called\n[Datsets](https://docs.seqera.io/platform-cloud/data/datasets)\nwhich can be used to store metadata needed to launch\na pipeline.\n\nThis node takes an input with title, description and file\ncontent as a string (eg. a single string with newlines)\nand creates a new Dataset, then attaches the file to it.\n\nAs elsewhere, there is a manual trigger attached to fire\nit, and the dataset contents are hardcoded.\nYou'll probably want to trigger it with some external\nautomation which then provides the file input.\n\nIt returns a Dataset ID as well as the full API response,\nwhich includes a URL that can be used when launching a pipeline.",
199+
"x": 300,
200+
"y": 260,
201+
"wires": []
202+
},
203+
{
204+
"id": "8f656afd1c473fa4",
205+
"type": "comment",
206+
"z": "5ddebd1124f2b1c0",
207+
"name": "Run and monitor a pipeline",
208+
"info": "The _Launch + Monitor_ node is a convenience node which packages\nup several functions. It combines the _Launch_ and _Monitor_\nnode functionality, as well as a timer which makes it easy\nto continue polling the running workflow for its status.\n\nIt has three outputs - one for each status ping,\none for when the pipeline finishes successfully, and one\nwhen it finishes with an error.\n\nHere we are using the same node twice, with two different\npipelines. This is a simple way to chain multiple workflows\nwithin Seqera Platform.",
209+
"x": 210,
210+
"y": 440,
211+
"wires": []
212+
}
213+
]

studios-template/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "node-red-seqera-data-studios",
3+
"description": "Run Node-RED on Seqera Platform Data Studios",
4+
"version": "0.0.1",
5+
"private": true,
6+
"scripts": {
7+
"start": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS"
8+
},
9+
"dependencies": {
10+
"axios": "^1.9.0",
11+
"node-red-seqera": "@seqera/node-red-seqera"
12+
}
13+
}

0 commit comments

Comments
 (0)