sdsc-hpc-training-org / reverse-proxy

1 stars 5 forks source link

Add command-line option to return only the RPS URL to standard output #9

Closed mkandes closed 3 years ago

mkandes commented 3 years ago

At present, the standard output when the start-jupyter script is run is for human consumption.

[mkandes@login02 reverse-proxy]$ ./start-jupyter -p debug -d $HOME -A use300 -t 30 -s jupyterlab
Your notebook is here:
https://kabob-tasty-umbilical.expanse-user-content.sdsc.edu?token=d89ae11cf1f5f536e20b7351ee5dd62c
If you encounter any issues, please email help@xsede.org and mention the Reverse Proxy Service.
Using ./slurm_expanse/jupyterlab.sh
Your job id is 1260366
You may occasionally run the command 'squeue -j 1260366' to check the status of your job
[mkandes@login02 reverse-proxy]$

To integrate the start-jupyter script with the Open OnDemand Portal project, we need an option to return only the URL.

[mkandes@login02 reverse-proxy]$ ./start-jupyter -p debug -d $HOME -A use300 -t 30 -s jupyterlab -q
https://kabob-tasty-umbilical.expanse-user-content.sdsc.edu?token=d89ae11cf1f5f536e20b7351ee5dd62c
[mkandes@login02 reverse-proxy]$

where '-q' is for quiet output. Something like that such that the URL can be assigned to a variable.

[mkandes@login02 reverse-proxy]$ jupyter_url="$(./start-jupyter -p debug -d $HOME -A use300 -t 30 -s jupyterlab -q)"
[mkandes@login02 reverse-proxy]$ echo "${jupyter_url}"
https://kabob-tasty-umbilical.expanse-user-content.sdsc.edu?token=d89ae11cf1f5f536e20b7351ee5dd62c
[mkandes@login02 reverse-proxy]$ 
JamesMcDougallJr commented 3 years ago

I added a -q option, here's example output: (base) [jamesmcd@comet-ln3 reverse-proxy]$ ./start-jupyter -q https://variety-bakeshop-chewing.comet-user-content.sdsc.edu?token=dac916aa296101f0b44698dbaafbfca4 (base) [jamesmcd@comet-ln3 reverse-proxy]$