How to Install miniforge

    This guide explains how to install "Miniforge" in the home area of OCTOPUS.
    Log in to OCTOPUS and follow the steps below. In this guide, we use /octfs/home/(user_id)/miniforge3 as the directory for installing Miniforge. Please replace it with your own directory as appropriate.
     
    1. Limit the number of threads used by Miniforge.
    In environments with a large number of cores, such as the OCTOPUS front-end, Mamba may hang. Please set the following environment variables to limit the number of threads Mamba uses.

    2. Download and run the Miniforge installer.

    3. Set the environment variables needed to use Miniforge. This setting is not necessary for subsequent uses.

    (Note) Installing Miniforge updates ~/.bashrc. However, if conda-related software is already installed, ~/.bashrc may not be updated correctly. In such a case, edit .bashrc, delete the lines from "# >>> conda initialize >>>" to "# <<< conda initialize <<<", and then re-execute "/octfs/home/(user_id)/miniforge3/bin/conda init".

 

How to use Miniforge

    List of virtual environments

      Displays the list of virtual environments that have already been built.

      mamba env list
      Name Active Path
      ───────────────────────────────────────────────
      base * /octfs/home/(user_id)/miniforge3

       

    Creating a new virtual environment

      The following is the procedure for creating a new virtual environment called test-env in the user area.

      First, generate the virtual environment test-env.

      mamba create --name test-env python=3.10

      If you view the list of virtual environments, you will see that test-env has been generated.

      mamba env list
      Name Active Path
      ─────────────────────────────────────────────────────────────────
      base * /octfs/home/(user_id)/miniforge3
      test-env /octfs/home/(user_id)/miniforge3/envs/test-env

       

    Enabling the virtual environment

      Enable the virtual environment test-env.

      mamba activate test-env

       

    Installing software in a virtual environment

      Install the Python library numpy in the virtual environment test-env. Since communication to the outside world is not possible from a compute node, please make sure to do this on the login node.

      mamba install numpy

       

    Disable the virtual environment

      Disable the virtual environment test-env.

      mamba deactivate

       

    How to use in OCTOPUS calculation node

    Please make the following job script when you enable the virtual environment "test-env" and execute test.py on one CPU node of OCTOPUS.

How to change the save location for virtual environments and packages

    By default, virtual environments and packages are installed in the ~/miniforge3 directory under your home directory. Therefore, creating numerous virtual environments or installing a large number of packages may cause your home directory to exceed its storage capacity.
     
    By setting the virtual environment and package save location to the work area using the following command before creating the virtual environment, you can prevent the home area from exceeding its capacity.

    mamba config prepend envs_dirs /octfs/work/(group_name)/(user_id)/mamba_envs
    mamba config prepend pkgs_dirs /octfs/work/(group_name)/(user_id)/mamba_pkgs