Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing hang fix #152

Merged
merged 4 commits into from
Mar 27, 2022
Merged

Parsing hang fix #152

merged 4 commits into from
Mar 27, 2022

Conversation

kmpaul
Copy link

@kmpaul kmpaul commented Mar 25, 2022

Change Summary

This PR fixes the problem referenced in #148, and it includes a mild refactor. This PR changes the run_command method to accept an asynchronous argument and skip error checking / early exit when True. Then, to assure that the arguments to the self.shell part of the remote command are correct (i.e., uses -lc when not using csh-style shells), the call to remotely launch Jupyter Lab is sent using run_command, to be consistent with all other remote commands used throughout Jupyter Forward.

Related issue number

Closes #148

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable

It is my belief that this change is internal and doesn't need additional documentation.

A test of the run_command method should be added to test the asynchronous argument.

@kmpaul kmpaul mentioned this pull request Mar 25, 2022
@kmpaul kmpaul requested review from mnlevy1981 and andersy005 March 25, 2022 20:46
@rsignell-usgs
Copy link
Contributor

rsignell-usgs commented Mar 26, 2022

Tested it on Windows 10 WSL2, works great -- opens browser tab and everything!

$ jupyter-forward rsignell@denali --launch-command "srun -A woodshole -N 1 -t 00:30:00" --conda-env pangeo --port 8889
************************************************************************************** Authenticating **************************************************************************************
Authenticating user (rsignell) from client (IGSAGIEGLTRSI10) to remote host (denali.cr.usgs.gov)
✅ The client is authenticated successfully
********************************************************************************* Verifying shell location *********************************************************************************
✅ Using shell: /bin/bash
****************************************************************************** Running jupyter sanity checks *******************************************************************************
/bin/bash -lc "source activate pangeo && which jupyter"
/home/rsignell/miniconda3/bin/jupyter
*************************************************************************  Creating log file on denali.cr.usgs.gov *************************************************************************
/bin/bash -lc "printenv TMPDIR"
/bin/bash -lc "printenv HOME"
/home/rsignell
/bin/bash -lc "touch $HOME/foobar && rm -rf $HOME/foobar && echo '$HOME is WRITABLE' || echo '$HOME is NOT WRITABLE'"
/home/rsignell is WRITABLE
/bin/bash -lc "mkdir -p $HOME/.jupyter_forward"
✅ Log directory is set to $HOME/.jupyter_forward
/bin/bash -lc "touch $HOME/.jupyter_forward/log_2022-03-26T07-15-14.txt"
✅ Log file is set to $HOME/.jupyter_forward/log_2022-03-26T07-15-14.txt
******************************************************************************** Preparing Batch Job script ********************************************************************************
/bin/bash -lc "echo -n '#!' > $HOME/.jupyter_forward/batch_job_script_2022-03-26T07-15-14"
/bin/bash -lc "echo /bin/bash -l >> $HOME/.jupyter_forward/batch_job_script_2022-03-26T07-15-14"
/bin/bash -lc "echo 'source activate pangeo && jupyter lab --no-browser --ip=\$(hostname -f) > $HOME/.jupyter_forward/log_2022-03-26T07-15-14.txt 2>&1' >> $HOME/.jupyter_forward/batch_job_script_2022-03-26T07-15-14"
/bin/bash -lc "chmod +x $HOME/.jupyter_forward/batch_job_script_2022-03-26T07-15-14"
✅ Batch Job script resides in $HOME/.jupyter_forward/batch_job_script_2022-03-26T07-15-14
********************************************************************************** Launching Jupyter Lab ***********************************************************************************
/bin/bash -lc "srun -A woodshole -N 1 -t 00:30:00 $HOME/.jupyter_forward/batch_job_script_2022-03-26T07-15-14"
******************************************************************************** Setting up port forwarding ********************************************************************************
remote_host: nid00025, remote_port: 8888, local_port: 8889
************************************************************************ Opening Jupyter Lab interface in a browser ************************************************************************
Jupyter Lab URL: http://localhost:8889
*********************************************************************************************  *********************************************************************************************
/bin/bash -lc "tail -f $HOME/.jupyter_forward/log_2022-03-26T07-15-14.txt"
[I 2022-03-26 06:16:13.500 ServerApp] jupyter_server_proxy | extension was successfully loaded.
[I 2022-03-26 06:16:13.501 LabApp] JupyterLab extension loaded from /home/rsignell/miniconda3/lib/python3.9/site-packages/jupyterlab
[I 2022-03-26 06:16:13.501 LabApp] JupyterLab application directory is /home/rsignell/miniconda3/share/jupyter/lab
[I 2022-03-26 06:16:13.505 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-03-26 06:16:13.506 ServerApp] Serving notebooks from local directory: /home/rsignell
[I 2022-03-26 06:16:13.506 ServerApp] Jupyter Server 1.13.4 is running at:
[I 2022-03-26 06:16:13.506 ServerApp] http://nid00025:8888/lab
[I 2022-03-26 06:16:13.506 ServerApp]  or http://127.0.0.1:8888/lab

Copy link
Member

@andersy005 andersy005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for tracking down this issue and for the fix, @kmpaul! LGTM

@kmpaul kmpaul merged commit 077974d into ncar-xdev:main Mar 27, 2022
@kmpaul kmpaul deleted the parsing-hang-fix branch March 27, 2022 18:10
@rsignell-usgs
Copy link
Contributor

@kmpaul or @andersy005, could we cut a new release so folks can install from conda-forge?

@andersy005
Copy link
Member

@rsignell-usgs, the latest version is available on PyPI. it might take a while for it to be available on conda-forge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hanging on parsing
3 participants