-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Description
BatchSpawner
fails on one of our Grid Engine clusters due to sudo
being unable to export the environment (enabled by it's -E
argument). We only allow certain environment variables to be exported - from our sudoers
:
Defaults:jupyter env_keep+="SGE_ROOT SGE_CELL SGE_EXECD_PORT SGE_QMASTER_PORT SGE_CLUSTER_NAME LANG JPY_API_TOKEN"
jupyter host1, host2 = (ALL) NOPASSWD: /usr/local/sge/live/bin/lx-amd64/qsub
jupyter host1, host2 = (ALL) NOPASSWD: /usr/local/sge/live/bin/lx-amd64/qstat
jupyter host1, host2 = (ALL) NOPASSWD: /usr/local/sge/live/bin/lx-amd64/qdel
To work around this issue I've added the following to our jupyterhub_config.py
:
# Need to tailor use of sudo to ShARC as exporting of entire environment
# using sudo's -E argument is not permitted here
sudo_prefix = 'sudo -u {username} '
c.GridengineSpawner.batch_submit_cmd = sudo_prefix + 'qsub'
c.GridengineSpawner.batch_query_cmd = sudo_prefix + 'qstat -xml'
c.GridengineSpawner.batch_cancel_cmd = sudo_prefix + 'qdel {job_id}'
but do others think it would be nicer to have a neater way of setting this e.g. a can_sudo_export_env
boolean trait?
Metadata
Metadata
Assignees
Labels
No labels