3.5. Spack Package Manager#
Spack is a powerful package management tool designed for supercomputers, clusters, and workstations, simplifying the process of installing, managing, and sharing software across different platforms. It supports flexible dependency resolution, multiple versions and configurations of software, and allows for easy deployment of software stacks. This section will guide you through the basics of using Spack to manage software on the Kempner AI cluster.
3.5.1. Spack Installation#
To install Spack, pick a shared folder on your lab directory on Kempner AI cluster (holylabs
or other Tier 0 storages such as holylfs0x
or Tier 1). This allows all lab members to use the packages and avoid saving similar packages multiple times.
mkdir /n/holylabs/LABS/<lab_name>/Lab/software
cd /n/holylabs/LABS/<lab_name>/Lab/software
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
cd spack
Replace <lab_name>
with your lab name on the cluster. To activate Spack, you can either run the command in .../spack/
root directory,
./share/spack/setup-env.sh
or add this line to ~/.bashrc
file to always activate Spack,
source <spack_path>/share/spack/setup-env.sh
Replace <spack_path>
with the root directory of the Spack (/n/holylabs/LABS/<lab_name>/Lab/software/spack
).
3.5.2. Useful Spack Commands#
The following tables summarizes the basic commands for managing software packages with Spack, from searching and installation to managing the software environment.
Spack Command |
Description |
---|---|
|
Displays packages installed on the cluster. |
|
Installs a new package on the cluster. |
|
Removes an installed package from the cluster. |
|
Makes a package ready for use in the current session. |
|
Removes a package from the current session’s environment. |
|
Lists all packages available for installation on the cluster. |
|
Provides details about a specific package available on the cluster. |
|
Shows all available versions of a package for installation on the cluster. |
Where <package>
is the name of package.
3.5.3. Advanced Topic: Spack Environments#
A Spack environment is a key feature of Spack, enabling users to manage software packages, dependencies, and configurations collectively. It ensures the easy replication of software setups across various AI clusters, aiding researchers, developers, and sysadmins in maintaining consistency and avoiding compatibility issues.
A list of useful Spack environment commands,
Spack Environment Command |
Description |
---|---|
|
Find out the current active Spack environment. |
|
List all Spack environment. |
|
Create a new Spack environment. |
|
Activate a Spack environment. |
|
Deactivate an environment. |
|
Install a package in the new environment. |
{Add more command for exportng Spack environment YAML file and importing in a different system.}