3 - Cluster Installation
Set up your environment
Install python
First, connect to your interactive HPC node.
You will need python 3.8 or later, and how this is done may vary per cluster.
For example, if your cluster has a module
system, the command may be something like this:
You may also directly be able to install python with the following if you have root privileges:
Check with your sysadmin or documentation for more information.
Record any commands required, then check the command is healthy and in your path:
Install hpc-client into your Python environment
Depending on how you are deploying the hpc-client
, you may choose from the following options for installing the hpc-client
into a Python environment:
-
(preferred) Install the
hpc-client
to the User Site -
Install the
fw-hpc-client
for all users (needs admin privileges). -
Create a Python environment to run the
hpc-client
from (NOTE: This can work with other Python virtual environment managers (e.g.venv
,poetry
) but specific instructions will not be provided here).-
Add pipenv to your homedir:
-
Install dependencies in your
<configuration directory>
-
Ensure this environment is activated in the
start-cast.sh
file (see below)
-
Run fw-hpc-client setup
Prepare your cluster-specific files by running the setup command.
Note: For other fw-hpc-client
commands see the documentation or the output of fw-hpc-client --help
.
Important - in a shared environment, protect your credentials:
Configure
A new settings
folder was just generated.
You need to edit each of these files in turn to configure it for your cluster:
Filename | Purpose |
---|---|
cast.yml | High-level settings |
credentials.sh | Sensitive information and Singularity environment config options |
start-cast.sh | Bootstrap script |
Each file has a variety of comments to guide you through the process.
Work with your collaborating Flywheel employee on these settings, particularly the connection credential (i.e., SCITRAN_CORE_DRONE_SECRET
in credentials.sh
).
Folder settings
There are five different directories/folders that one should consider. Four of these default folders can be changed by exporting/setting the corresponding environment variable in fw-cast/settings/credentials.sh
SINGULARITY_TMPDIR
"When building a container, or pulling/running a SingularityCE container from a Docker/OCI source, a temporary working space is required. The container is constructed in this temporary space before being packaged into a SingularityCE SIF image."
SINGULARITY_WORKDIR
"The working directory to be used for /tmp
, /var/tmp
and $HOME
(if -c or --contain was also used)".
Instead of mounting to the default directory of the OS--i.e., tmp
(not to be confused with the singularity image's tmp
directory)--one can mount a drive that can handle intermediate files generated when the singularity image is run.
This directory must be owned by the user executing start-cast.sh
with user-only read/write permissions (0600
).
Note: when the singularity container is built and the hpc-client
executes singularity, it passes the flag --containall
, which does not mount a user's $HOME
directory and additionally contains PID, IPC, and environment. One can set this flag when developing and testing singularity images to simulate similar conditions.
SINGULARITY_CACHEDIR
When a gear is pulled and converted to a sif file, this folder is where both docker and sif images are stored. The cache is created at $HOME/.singularity/cache
by default.
This directory must be owned by the user executing start-cast.sh
with user-only read/write permissions (0600
).
Engine folders
The folders ENGINE_CACHE_DIR
and ENGINE_TEMP_DIR
are where gear inputs and output files will be stored. These should be set to a location that will be able to handle the size of both input and output files, and both should be set to the same directory.
Log folders
When the hpc-client
finds a job from a Flywheel instance, it creates an executable script (.sh
) for the job and its associated log file. The job id will be the in the title of executable and its .txt
log file; they are stored in the directories fw-cast/logs/generated
and fw-cast/logs/queue
, respectively.
The executable job script is created from a SCRIPT_TEMPLATE
(found in fw-cast/src/cluster
), depending on the HPC's job scheduler/cluster type (e.g., slurm). If you need to customize it for your HPC, it is recommended that you change create your own template in settings/cast.yml
using the variable script
. The start-cast.sh
file logs this template in fw-cast/logs/cast.log
. When troubleshooting an HPC gear, it is convenient to use the command tail -60 fw-cast/logs/cast.log
to print out the last 60 lines from the log file, since this can get quite long.
start-cast.sh
Python Environment
If you are using a specific Python environment you will need to activate that environment before executing the hpc-client
. For example, using pipenv
you may have the last line of the start-cast.sh
script as