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

hpc instructions to use mamba and small fixes #826

Merged
merged 3 commits into from
Jul 3, 2021

Conversation

rsignell-usgs
Copy link
Member

@rsignell-usgs rsignell-usgs commented Apr 6, 2021

fixes #825

@rsignell-usgs rsignell-usgs marked this pull request as draft April 6, 2021 12:19
@rsignell-usgs rsignell-usgs mentioned this pull request Apr 8, 2021
Copy link
Member

@guillaumeeb guillaumeeb left a comment

Choose a reason for hiding this comment

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

Just two remarks, otherwise this looks really good!


::

conda update conda
conda config --add channels conda-forge --force
conda config --remove channels defaults --force
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why you need to use only conda-forge? This is to ensure the best compatibility between all the dependencies. This config might prevent using other channels like pytorch, don't this?
But at this point if a user needs other channels he knows what he's doing, so maybe that's OK.

Copy link
Contributor

@ocefpaf ocefpaf Apr 29, 2021

Choose a reason for hiding this comment

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

Any kind of channel mixing is problematic. We always recommend to use only 1 and, if it is extremely necessary, add the extra channel in the env file configuration. However, of keeping defaults and conda-forge in the condarc is usually problematic, specially without strict channel policy. That is b/c those two channels overlap a lot. It is not like getting pytorch from another channel, it is like mixing from two different sources for most, if not all, packages.

The other big advantage, besides avoiding compatibility issues, is to speed up the solver time by reducing the amount of packages it has to work with. Single channel reduces the scope by at least half and speed things up considerably.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the clarification Filipe! This has been a moving target for many of us, so good to know that one channel is the way to go now!

echo "Step 2: Copy this ssh command into a terminal on your"
echo " local computer:"
echo ""
echo " ssh -N -L 8889:`hostname`:$JPORT [email protected]"
Copy link
Member

Choose a reason for hiding this comment

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

poseidon.whoi.edu: maybe replace with a generic name.

Comment on lines 181 to +224
developed a `start-notebook <https://www2.cisl.ucar.edu/resources/computational-systems/cheyenne/software/jupyter-and-ipython#notebook>`__
utility that wraps the following steps into a single execution. You should
check with your system administrators to see if they have something similar.
If not, you'll need to take the following steps:

Copy this line into your terminal. It will echo a command you'll want to use
later.
If not, you can easily create your own start_jupyter script. In the script below, we choose a random port
on the server (to reduce the chance of conflict with another user), but we use port 8889 on the client, as port 8888 is
the default client port if you are running Jupyter locally. We can also change to a starting directory:

::

(pangeo) $ echo "ssh -N -L 8888:`hostname`:8888 [email protected]"
ssh -N -L 8888:r8i4n0:8888 [email protected]

Now we can launch the notebook server:

(pangeo) $ more ~/bin/start_jupyter
cd /home/data/username
JPORT=$(shuf -i 8400-9400 -n 1)
echo ""
echo ""
echo "Step 1: Wait until this script says the Jupyter server"
echo " has started. "
echo ""
echo "Step 2: Copy this ssh command into a terminal on your"
echo " local computer:"
echo ""
echo " ssh -N -L 8889:`hostname`:$JPORT [email protected]"
echo ""
echo "Step 3: Browse to https://localhost:8889 on your local computer"
echo ""
echo ""
sleep 2
jupyter lab --no-browser --ip=`hostname` --port=$JPORT

Now we can launch the Jupyter server:
::

(pangeo) $ jupyter lab --no-browser --ip=`hostname` --port=8888
(pangeo) $ ~/bin/start_jupyter

Step 1:...
Step 2:...
Step 3:...
...
[I 13:36:52.321 LabApp] The Jupyter Notebook is running at:
[I 13:36:52.321 LabApp] http://r8i4n0:8888/
[I 13:36:52.321 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Now, connect to the server using an ssh tunnel from your local machine
(this could be your laptop or desktop).

::

$ ssh -N -L 8888:r8i4n0:8888 [email protected]

[I 2021-04-06 06:33:57.962 ServerApp] Jupyter Server 1.5.1 is running at:
[I 2021-04-06 06:33:57.962 ServerApp] http://pn009:8537/lab
[I 2021-04-06 06:33:57.963 ServerApp] or http://127.0.0.1:8537/lab
[I 2021-04-06 06:33:57.963 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

You'll want to change the details in the command above but the basic idea is
that we're passing the port 8888 from the compute node `r8i4n0` to our
local system. Now open http://localhost:8888 on your local machine, you should
find a jupyter server running!
Just follow the Steps 1,2,3 printed out by the script to get connected.
Copy link
Member

@andersy005 andersy005 Apr 15, 2021

Choose a reason for hiding this comment

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

📣 Shameless plug 📣 ;) : You could replace all of this with a single command via jupyter-forward - Jupyter-forward launches Jupyter Lab over SSH (on any computing cluster) with a single command !

Here are some examples:

Copy link
Member Author

Choose a reason for hiding this comment

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

@andersy005 , what do you think about leaving these steps in here, and then saying that many of them can be automated by jupyter-forward as long as you are not on windows?

I'm hesitant to just replacing this with jupyter-forward recommendation until ncar-xdev/jupyter-forward#81 is figured out.

Copy link
Member Author

Choose a reason for hiding this comment

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

@andersy005 , what do you think about just merging this and following it with something about jupyter forward as another PR?

@rsignell-usgs rsignell-usgs marked this pull request as ready for review June 21, 2021 20:15
@guillaumeeb
Copy link
Member

I'll just go ahead and merge this one!

@guillaumeeb guillaumeeb merged commit 16de87a into master Jul 3, 2021
@rsignell-usgs rsignell-usgs deleted the rsignell-usgs-patch-1 branch September 14, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify HPC instructions to use base env for jupyterlab
4 participants