Let's start.
Welcome to today's HPC Cafe.
And today we are going to talk about software installation for users and how users can install software with Conda,Containers or Spack.
Talks are given by myself, Markus Wittmann, by my colleagues Katrin Nosse and Jonas Ruben.
So let's start right away.
And first we will have a look at how you manage your software installation with Conda.
So Conda itself is a package manager and environment manager.
You might know already PIP, which is also a package manager for Python, but PIP only deals with Python packages.
Conda in contrast can do anything. So it's not limited to Python itself.
And Conda is the package manager you get when you use an Anaconda or MiniConda distribution.
By default, it's configured to take its packages from the Anaconda repository, but you are also free to add other repositories or channels, however they are called, from CondaForge or BioForge.
We will look at this later.
Documentation and cheat sheet you find on the slides, the link there to there.
When you are at our systems and use a Python module, typically Python slash version of Python minus Anaconda, then you're already using not only the Python of a certain version, but you also have an Anaconda installation at hand.
The installation has a base environment and in this base environment you already get a lot of packages.
This means you do not have to install an Anaconda or MiniConda distribution by yourself. You just can start with our base environment.
So, for example, if you are on Alex or any other cluster and load the corresponding Python module, then you have Conda available.
And if you do a Conda list to see all the packages available, you will see that there are over 150 already installed.
And then please do one thing. If you are the first time on our systems and load Python, please change the Python, the Conda config, accordingly to the two commands on this slide.
What they do is they tell Conda to install their packages and environments not to your home, but to your dollar work file system.
The reason is that on home we have backup and we have limited space and for packages and environments, which you typically can easily recreate, you just can use work.
But as I said, you only have to do this once and it works then for every cluster and every Python module you load.
OK, then let's assume we have done this and we want to create environments. What are environments?
In Conda, an environment is more or less a name collection of installed packages, which you can activate or deactivate in your shell.
You can switch between them. And this is more or less probably something you already know from Python virtual environments.
And like with Python virtual environments, you typically have several environments available, typically for different projects with different packages and different versions installed.
And the nice thing is Conda environments work together up to a certain degree with PIP. So if you're going to use PIP later, then this probably works.
How do you set up an environment? You just call Conda create minus n name of the environment and then you already can specify which packages you want to install.
Optionally followed by some version restriction, like here on the slides, I have an example. I create a certain environment and specify Python as installation package in the version of 3.10.
And as I said, Conda is not limited to Python packages. In Conda, Python is also a package, so I can install it.
And tell this environment I want to have a certain Python version. And if you're going to use PIP later in this environment, please install explicitly a Python or PIP package.
If you don't do this and later use PIP in such an environment, PIP will install the packages not inside the environment. It will install the packages inside the environment.
It will install it into the user side directory.
OK, and with Conda remove minus minus name environment, name minus minus all, you get rid of the environment.
You will also often find that on Conda you have two options to execute a certain command, Conda env something and you can also use the Conda
to execute a certain command, Conda env something and Conda without env. Often they do not share exactly the same parameters.
So you have to take a look at the documentation. When you have created an environment, you can activate it with Conda activate, followed by the name of the environment.
And what Python then does, what Conda does is it prefixes your prompt with the name of the environment.
Like here in this example, we have an environment called a torch. We activate it and then our prompt gets from the dollar change to torch in parentheses followed by the dollar.
Conda deactivate, I deactivate the environment. And if I want to know how environments are installed, I can use Conda info minus minus end or Conda env list.
And then I get a list of all the environments, like here at the bottom of the slide.
And the active environment, like here, it's the test environment is marked with a star.
You also see them where the environments are installed. Environments that are under slash apps are environments we have created.
And these environments you can load, but you cannot change them. Obviously, you can only change your own and they typically reside them under slash home.
Okay, inside an environment, I already said you can install packages. You can list with Conda list the packages which are installed in an environment.
You can search for packages, packages with Conda search, and you can also include wild cards in the package name.
For example, if you want to see all the packages which start with pytorch, then you would say Conda search pytorch star.
Important thing is to quote the wild cards, else they might get expanded by your share before they reach the Conda utility.
If you know the name of the package you want to install, then just run Conda install the package name, followed optionally by some version requirement.
I only listed here the equal sign, but you can also specify larger than lower than what I mean.
Presenters
Zugänglich über
Offener Zugang
Dauer
00:43:17 Min
Aufnahmedatum
2023-09-12
Hochgeladen am
2023-09-15 16:56:02
Sprache
en-US
Topic: Software installation for users - Containers, Conda, SPACK
Speaker: Dr. Markus Wittmann, Dr. Katrin Nusser, and Thomas Gruber (NHR@FAU)
Abstract: Installing their own software packages is often a challenge for users of HPC clusters. However, depending on the requirements, multiple solutions exist that can facilitate the task of making a complex software package available. In this HPC Cafe, we will cover three popular systems for user software installation and management on NHR@FAU systems: Conda, Containers (specifically Apptainer, a.k.a. Singularity), and SPACK.
Material from past events is available at: https://hpc.fau.de/teaching/hpc-cafe/