Migrating to Pixi-Powered SalishSeaCmd

If you are running NEMO on one of the Alliance HPC clusters, an easy way to start using Pixi is to migrate your SalishSeaCmd installation and workflow to Pixi. The steps are:

  1. Install Pixi on the Alliance cluster (if you have not already done so)

  2. Pull the most recent version of SalishSeaCmd from GitHub

  3. Use Pixi to to create an isolated environment for SalishSeaCmd

  4. Use pixi run salishsea run... to launch a run

  5. Clean up the elements of your old conda-powered installation

Install Pixi

$ curl -fsSL https://pixi.sh/install.sh | bash

Having Pixi autocomplete its sub-commands, option flags, environment names, etc. when you hit Tab is very convenient. To enable that, add the following line to your $HOME/.bashrc file:

eval "$(pixi completion --shell bash)"

After installation, please restart your terminal session to finalize the installation.

Update SalishSeaCmd

$ cd $HOME/SalishSeaCmd/
$ git pull

Note

Depending on when you set up SalishSeaCmd on the cluster, it is possible that its path is different to $HOME/MEOPAR/SalishSeaCmd/. The next most likely possibility is $PROJECT/$USER/MEOPAR/SalishSeaCmd/.

Create the SalishSeaCmd Environment

$ pixi install

Use pixi run salishsea run...

When you are in the SalishSeaCmd/ directory (or a sub-directory) you can run the salishsea command with with the pixi run command. Example:

$ pixi run salishsea help

A common use-case is to execute the salishsea run command in the directory containing your run description YAML file. To accomplish that, you have to tell Pixi where to find the SalishSeaCmd/ directory so that it can use the correct environment. You do that by using the -m or --manifest option of pixi run. Example:

$ cd SS-run-sets/SalishSea/sea/Carbon_v202111/
$ pixi run -m $HOME/MEOPAR/SalishSeaCmd salishsea run 01jan11_Lb80.yaml \
    /scratch/allen/Carbon/MoreSens/Now/01jan11/

Cleanup

  1. Uninstall SalishSeaCmd from $HOME/.local/bin/

    $ conda activate salishsea-cmd
    $ python -m pip uninstall SalishSeaCmd
    
  2. Uninstall NEMO-Cmd from $HOME/.local/bin

    $ python -m pip uninstall NEMO-Cmd
    
  3. Remove your salishsea-cmd conda environment

    $ conda deactivate
    $ conda env remove -n salishsea-cmd
    
  4. Remove your NEMO-Cmd repository clone

    Installation and updating of NEMO-Cmd is now handled by Pixi because NEMO-Cmd is now an implicit dependency for SalishSeaCmd in its manifest file. So, you can remove your NEMO-Cmd repository clone:

    $ rm -rf $HOME/MEOPAR/NEMO-Cmd/
    

    Note

    Depending on when you set up SalishSeaCmd on the cluster, it is possible that the path is different to $HOME/MEOPAR/NEMO-Cmd/. The next most likely possibility is $PROJECT/$USER/MEOPAR/NEMO-Cmd/.

  5. Remove NEMO-Cmd from the vcs revisions: sections of your run description YAML files.

    If you don’t you will get warnings like:

    nemo_cmd.prepare WARNING: revision and status requested for non-existent repo: /home/dlatorne/MEOPAR/NEMO-Cmd
    

    every time you use pixi run salishsea run ...

  6. Remove conda (if the only environment left is base)

    If the output of:

    $ conda env list
    

    shows only the base environment like:

    # conda environments:
    #
    base                     /home/allen/miniforge3
    

    follow the Uninstall instructions for Miniforge to remove it.

    If you have environments in addition to base left, migrate them to Pixi before you remove conda. Please contact Doug if you need help.