jupyterhub / batchspawner

Custom Spawner for Jupyterhub to start servers in batch scheduled systems
BSD 3-Clause "New" or "Revised" License
190 stars 134 forks source link

epilogue not working #260

Open lifetooeasy opened 1 year ago

lifetooeasy commented 1 year ago

Bug description

It seems that epilogue is not working after stopping the notebook. I set up the epilogue parameter in the configuration file like this:

c.SlurmSpawner.req_epilogue = """!/bin/bash echo 'hostname'""" (just an example). I am able to see the command in jupyterhub log after cmd but nothing happens.

Expected behaviour

run epilogue after stopping the notebook.

Actual behaviour

Your personal set up

# jupyterhub_config.py
c.SlurmSpawner.req_epilogue = """!/bin/bash echo 'hostname'"""
welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

mbmilligan commented 1 year ago

Hello! Would you try setting this variable like so instead:

c.SlurmSpawner.req_epilogue = "echo 'hostname'"

The req_epilogue variable is substituted into the Slurm script as-is after the cmd returns, it's not a separate script. The #!/bin/bash prefix is unnecessary, and results in the line being ignored as a comment.

lifetooeasy commented 1 year ago

@mbmilligan it still not working. Just for information req_prologue works fine. Can Slurm Admin restrict prologue/epilogue?