jupyterhub / jupyterhub/batchspawner

setting keepvars_extra globaly

Open
#153 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
207
Forks
136
PR merge metrics
No merged PRs in 30d

Description

I am using ProfileSpawner with batchspawner and I managed to have it working.
However, there's something which I don't fully understand.
As I have seen in the examples I have defined variables at the top level for the partition and nprocs while defined amount of RAM and time in each profile.

I have tried to set the req_keepvars_extra at the top level as I want it for all the profiles. Nonetheless, it only works if I set it in the profile. In the example below only the first profile works.
```
import batchspawner
c.JupyterHub.hub_ip = '0.0.0.0'
c.JupyterHub.cookie_max_age_days = 8
c = get_config()
c.Spawner.http_timeout = 120

c.BatchSpawnerBase.req_nprocs = '2'
c.BatchSpawnerBase.req_partition = 'short'
c.BatchSpawnerBase.req_keepvars_extra = 'LD_LIBRARY_PATH'

c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'

c.ProfilesSpawner.profiles = [
('2 cores, 4 GB, 8 hours', '4gb', 'batchspawner.SlurmSpawner',
dict(req_runtime='8:00:00', req_memory='4gb', req_keepvars_extra='LD_LIBRARY_PATH')),
('2 cores, 128 GB, 4 hours', '128gb', 'batchspawner.SlurmSpawner',
dict(req_runtime='4:00:00', req_memory='128gb')),
]
```
Is there any way to set req_keepvars_extra globally?

Thanks for you help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.