Skip to content

Commit 1a06a1a

Browse files
committed
Update systemd units
1 parent 00f48ca commit 1a06a1a

8 files changed

+71
-18
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install-python:
2626

2727
install-systemd-units:
2828
mkdir -p "${DESTDIR}/etc/systemd/system/"
29-
install data/systemd/rnaseq-pipeline-viewer.service data/systemd/[email protected] "${DESTDIR}/etc/systemd/system/"
29+
install data/systemd/*.{service,timer,target} "${DESTDIR}/etc/systemd/system/"
3030
@echo "Remember to run 'systemctl override rnaseq-pipeline-viewer' and 'systemctl override rnaseq-pipeline-worker@' and set CONDA_BIN, CONDA_ENV, GEMMA_USERNAME and GEMMA_PASSWORD environment variables."
3131

3232
install-RSEM:

data/systemd/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
This directory contains systemctl unit and timers to launch the RNA-Seq
22
pipeline and its webviewer.
33

4+
To edit the configuration, issue: `systemctl edit [email protected]` and `systemctl edit rnaseq-pipeline-viewer.service`
5+
to add the following environment variables:
6+
7+
```
8+
[Service]
9+
WorkingDirectory=/location/of/the/pipeline/configuration
10+
Environment="CONDA_ENV=/path/to/conda/env"
11+
Environment="GEMMA_USERNAME={username}"
12+
Environment="GEMMA_PASSWORD={password}"
13+
```
14+
15+
# Launch workers
16+
17+
We run two workers, one is generally idle and awaits new datasets to be
18+
processed in a collaborative spreadsheet by our curators, the other is
19+
generally busy. Those are configured to restart after 20 minutes after exiting.
20+
21+
```
22+
23+
```
24+
25+
# Launch the viewer
26+
27+
```
28+
systemctl start rnaseq-pipeline-viewer.service
29+
```
30+
31+
# Enable the cleanup unit
32+
33+
Edit the configuration to set the working directory where the cleanup script
34+
can be resolved.
35+
36+
```
37+
[Service]
38+
WorkingDirectory=/location/of/the/pipeline/configuration
39+
```
40+
41+
```
42+
systemctl start rnaseq-pipeline-cleanup.timer
43+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Unit]
2+
Description=PavLab RNA-Seq Pipeline Cleanup
3+
4+
[Service]
5+
Type=simple
6+
ExecStart=/bin/bash -c "./scripts/remove-old-data"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=Cleanup the RNA-Seq Pipeline hourly
3+
4+
[Timer]
5+
OnCalendar=hourly
6+
7+
[Install]
8+
WantedBy=timers.target
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[Unit]
22
Description=PavLab RNA-Seq Pipeline Viewer
33
Requires=luigid.service
4-
After=multi-user.target
4+
After=network.target
55

66
[Service]
77
Type=simple
8-
WorkingDirectory=/space/grp/Pipelines/rnaseq-pipeline
9-
ExecStart=/space/grp/poirigui/miniconda3/condabin/conda run --no-capture-output -p /space/grp/Pipelines/rnaseq-pipeline/env gunicorn -e SCRIPT_NAME=/rnaseq-pipeline -b 0.0.0.0:8000 rnaseq_pipeline.webviewer:app --access-logfile pipeline-output/webviewer-logs/access.log --error-logfile pipeline-output/webviewer-logs/error.log
10-
User=poirigui
8+
ExecStart=/bin/bash -c "conda run --no-capture-output -p $CONDA_ENV gunicorn -e SCRIPT_NAME=/rnaseq-pipeline -b 0.0.0.0:8000 rnaseq_pipeline.webviewer:app --access-logfile pipeline-output/webviewer-logs/access.log --error-logfile pipeline-output/webviewer-logs/error.log"
119

1210
[Install]
1311
WantedBy=multi-user.target

data/systemd/[email protected]

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=PavLab RNA-Seq Pipeline Worker #%i
3+
Requires=luigid.service
4+
After=network.target
5+
6+
[Service]
7+
Type=simple
8+
ExecStart=bash -c "conda run --no-capture-output -p $CONDA_ENV luigi-wrapper --module rnaseq_pipeline.tasks --assistant --workers 200"

data/systemd/rnaseq-pipeline.service

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/remove-old-data

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
output_dir=/cosmos/data/pipeline-output/rnaseq
4+
5+
find "$output_dir/data/sra" -mtime +30 -delete -print
6+
find "$output_dir/data-trimmed" -mtime +30 -delete -print

0 commit comments

Comments
 (0)