Adding Custom Packages To cbcore Container
On This Page
Adding Custom Packages To cbcore Container¶
You can add custom packages to the Cerebras cbcore container. This section describes how to add two specific packages: the
networkx, to your Cerebras cbcore container.
Read this before you proceed further
Make sure that your system administrator has enabled the user control of binds for Singularity. See here for more: Bind Paths and Mounts — Singularity container 3.0 documentation .
Know that you are responsible to maintain the directory of packages you are installing in the Cerebras container (the
~/Cerebras-0.8.0-extra-python-packagesdirectory in the example installation instructions below).
Ensure that you map the directory containing these packages to all the Slurm nodes in your cluster, for example via NFS.
Create a directory shared between and accessible by all the hosts. For example, a directory with the name:
Run the following
singularity execcommand with
-Boption to perform the following two tasks:
$HOME/.localdirectory from within the Cerebras container, and
$HOME/.local. In reality these packages are installed in
~/Cerebras-0.8.0-extra-python-packagesdirectory but they are accessible within the Cerebras container as
singularity exec -B ~/Cerebras-0.8.0-extra-python-packages:$HOME/.local /<path>/cbcore-0.8.0-<identifier-string>.sif pip install --user spektral==1.0.7 networkx==2.6.2
Accessing the packages¶
Run the following command to test that the modules in the installed packages are accessible from within the Cerebras container:
singularity exec -B ~/Cerebras-0.8.0-extra-python-packages:$HOME/.local /<path>/cbcore-0.8.0-<identifier-string>.sif python -c 'import spektral; print(spektral.__file__)'
The output should resemble the following, if the
$HOME value is