A Brief Example

This example is about installing and using two Python packages pytorch and multiqc on Sol.

Step 1 - Search

Pytorch

Go to https://pytorch.org/get-started/locally/ and select options as shown below:

Screenshot 2024-12-10 at 1.56.04 PM.png

Pytorch is special, the correct command should always be gathered from this webpage (not anaconda.org). Other packages may also have such conflicts, when encountered, make sure to follow the instructions on the package official website or github repo.

The command given here CANNOT be directly used on ASU supercomputers, the section below will show you how to re-write the command.

 

Multiqc

Go to anaconda.org and search for multiqc in the search bar:

Screenshot 2024-11-13 at 1.53.54 PM.png

Click on one of the search results, usually the first one:

Exam the details on the following page, especially the version of the package:

The “conda install” on the above page gives the installation commands:

The conda part in the red circle needs to be changed to mamba, and the bioconda part in the blue box is the channel name of this multiqc package. Channel is similar to the name of an online folder, that mamba can find and download the correct package. This is important for the next step.

 

Step 2 - Install

  1. Connect to the VPN

  2. Open a command line interface on Sol by navigating to sol.asu.edu on your browser and
    selecting the "Sol Shell Access" option from the "System" menu option. Or by SSHing into
    Sol using the command ssh <asurite>@sol.asu.edu

  3. interactive -p htc -c 4 -t 30

  4. module load mamba/latest

  5. module load cuda-12.4.1-gcc-12.1.0

  6. Here we combine three things into a single command:

    1. Create an environment

    2. Install Pytorch using the command found in step 1

    3. Install Multiqc using the command found in step 1

      mamba create -n myENV -c conda-forge -c pytorch -c nvidia -c bioconda python=3 multiqc pytorch torchvision torchaudio pytorch-cuda=12.4
  7. And answer Y to the promoted question, if everything looks fine

  8. Wait till the installation finish

The -c flag in the above command means “channel". The channel name must be correct to install the correct package. More information can be found here: Managing Python Modules Through the Mamba Environment Manager

 

Step 3 - Use

Once the myENV environment is ready, multiqc can be used directly or within a python session/script.

  1. Connect to the VPN

  2. Open a command line interface on Sol by navigating to sol.asu.edu on your browser and
    selecting the "Sol Shell Access" option from the "System" menu option. Or by SSHing into
    Sol using the command ssh <asurite>@sol.asu.edu

  3. interactive -p htc -c 4 -t 30

  4. module load mamba/latest

  5. source activate myENV

  6. python

  7. import multiqc

 

Step 4 - What about pip?

As explained in Python Package Installation Method Comparison , if a package is not found on anaconda.org, but found on pypi.org , pip can be used inside a mamba env. This is the only correct way to use pip on the ASU supercomputers.

Almost all of the Python packages can be found on anaconda.org, and mamba is always preferred.

 

Here is an example of such a special package called q2-greengenes2:

The commands to have this package installed to a mamba env are:

  1. Connect to the VPN

  2. Open a command line interface on Sol by navigating to sol.asu.edu on your browser and
    selecting the "Sol Shell Access" option from the "System" menu option. Or by SSHing into
    Sol using the command ssh <asurite>@sol.asu.edu

  3. interactive -p htc -c 4 -t 30

  4. module load mamba/latest

  5. source activate myENV

  6. pip install q2-greengenes2

 

Step 5 - Jupyter Notebook

After multiqc and q2-greengenes2 have been installed to myENV, we want to use this mamba env in the Jupyter Notebook session on the Sol web portal. So we need to make a Jupyter kernel from this mamba env. More details are covered in Preparing Python Environments for Jupyter and here are the example steps:

  1. Connect to the VPN

  2. Open a command line interface on Sol by navigating to sol.asu.edu on your browser and
    selecting the "Sol Shell Access" option from the "System" menu option. Or by SSHing into
    Sol using the command ssh <asurite>@sol.asu.edu

  3. interactive -p htc -c 4 -t 30

  4. module load mamba/latest

  5. mkjupy myENV "myENV_kernel"

  6. Find and use myENV_kernel

    1. Log in to the Sol web portal

    2. On the top bar: Interactive Apps > Jupyter > Fill out request form > Connect to Jupyter

    3. Inside the Jupyter Notebook: Open a Launcher page > Click on myENV_kernel icon