Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article will guide you to use Jupyter Notebook via Miniconda on a LANTA HPC system, which requires ssh tunneling to LANTA HPC.

Table of Contents

Creating an environment using Miniconda

Module Load

  1. Use the ml av Miniconda command to see which version of Miniconda is available on the LANTA HPC system.

  2. Use the ml Miniconda3/xx.xx.x command to load the Miniconda version that you want to use. If we you don't specify a version, the module will load the default version (D) default versionis loaded, which in this case is Miniconda3/4.12.0 (D)22.11.1-1.

Conda environment

  1. source Miniconda3/4.x.x/bin/activate to activate conda

  2. Use the conda create -n myenv commands to create the conda environment with myenv name.

  3. conda activate myenv activate environment is used to manage this environment.

...

Code Block
(myenv) [username@lanta-frontend-1 prep]$ pip install jupyterlab
...

Reserve HPC resources for interactive use.

Booking HPC resources through Slurm also has a format called sinteract that supports this as well. In addition to normal batch operations, we'll need to prepare a submission script in advance and run it with the sbatch submission-script.sh command.

...

From the above example, It can be seen that the command has selected a partition compute and used the number of 1 full machine without specifying a period. Resulting in the lanta-c-059 to be used differently from using the default option as shown earlier.

Running Jupyter Notebook via ssh tunnelling

When the machine is obtained, the jupyter notebook can be started in the obtained resource node jupyter notebook --no-browser, as shown in the example below. We need to enter 3 windows, as following.

...

@mylocalmachine:~ $

@mylocalmachine:~ $ ssh -J <username>@lanta.nstda.or.th -L 8888:localhost:8888 -N <username>@<the machine number allocated by sinteract.>

In this example, the machine number allocated by sinteract is lanta-c-001.

...

Code Block
[username@lanta-frontend-1 prep]$ ml Miniconda3/4.8.3
[username@lanta-frontend-1 prep]$ source Miniconda3/4.x.x/bin/activate
[username@lanta-frontend-1 prep]$ conda create -n myenv
[username@lanta-frontend-1 prep]$ conda activate myenv
(myenv) [username@lanta-frontend-1 prep]$ pip install pythainlp[ner]
...
(myenv) [username@lanta-frontend-1 prep]$ thaiprep data get lst20-cls
Corpus: lst20-cls
- Downloading: lst20-cls 0.2
100%|█████████████████████████████████████████████████████████████████████| 3738912/3738912 [00:00<00:00, 14208949.66it/s]
Downloaded successfully.
(myenv) [username@lanta-frontend-1 prep]$ thaiprep data get thainer
Corpus: thainer
- Downloading: thainer 1.5
100%|██████████████████████████████████████████████████████████████████████| 1637304/1637304 [00:00<00:00, 6083390.29it/s]
Downloaded successfully.
(myenv) [username@lanta-frontend-1 prep]$ thaiprep data get thainer-1.4
Corpus: thainer-1.4
- Downloading: thainer-1.4 1.4
100%|██████████████████████████████████████████████████████████████████████| 1872468/1872468 [00:00<00:00, 6637009.99it/s]
Downloaded successfully.
(myenv) [username@lanta-frontend-1 prep]$ 

...

Related articles

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@48ae393
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel in ( "tunnelling" , "jupyter" ) and space = currentSpace ( )
labelssingularity python container

...