Skip to content

Commit e73ed40

Browse files
committed
add support for configurable POST endpoint
1 parent ba282b9 commit e73ed40

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

nextflowspawner/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@
1111
from urllib.parse import urlparse
1212

1313
def ignite():
14+
cmd = ['nextflow', 'run', os.environ['NXF_USER_WORKFLOW'], '--PORT={port}', '-resume']
15+
16+
if 'NXF_USER_REVISION' in os.environ:
17+
cmd.extend(['-r', os.environ['NXF_USER_REVISION']])
18+
if 'NXF_USER_PARAMS' in os.environ:
19+
cmd.extend(['-params-file', os.environ['NXF_USER_PARAMS']])
20+
if 'NXF_USER_ENDPOINT' in os.environ:
21+
cmd.extend(['-with-weblog', os.environ['NXF_USER_ENDPOINT']])
22+
1423
return {
15-
'command': ['nextflow', 'run', os.environ['NXF_USER_WORKFLOW'], '-r', os.environ['NXF_USER_REVISION'], '--PORT={port}', '-resume', '-params-file', os.environ['NXF_USER_PARAMS']],
24+
'command': cmd,
1625
'timeout': 120,
1726
'launcher_entry': {'title': 'Nextflow'}
1827
}
@@ -25,9 +34,10 @@ class NextflowSpawner(LocalProcessSpawner):
2534
workflow_revision = Unicode('main', config=True, help="The revision of the pipeline repository.")
2635

2736
home_dir_template = Unicode('/home/{username}', config=True, help="Template to expand to set the user home. {username} is expanded to the jupyterhub username.")
28-
2937
home_dir = Unicode(help="The user home directory")
3038

39+
log_endpoint = Unicode(None, config=True, allow_none=True, help="The http endpoint for nf-weblog.")
40+
3141
@default('home_dir')
3242
def _default_home_dir(self):
3343
return self.home_dir_template.format(username=self.user.name)
@@ -175,4 +185,6 @@ def get_env(self):
175185
env['NXF_USER_WORKFLOW'] = self.workflow_url
176186
env['NXF_USER_REVISION'] = self.workflow_revision
177187
env['NXF_USER_PARAMS'] = self._write_params_file(self.user_options)
188+
if self.log_endpoint:
189+
env['NXF_USER_ENDPOINT'] = self.log_endpoint
178190
return env

setup.py

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

33
setuptools.setup(
44
name="nextflowspawner",
5-
version='0.8.2',
5+
version='0.8.3',
66
url="https://github.com/phue/nextflowspawner",
77
description="Spawn Nextflow pipelines from Jupyterhub and configure them interactively",
88
author="Patrick Hüther",

0 commit comments

Comments
 (0)