Using the AWS PCS multi-cluster login node configuration script
Running the script
To run the configuration script
-
Save the content of the script in a file named:
pcs-multi-cluster-login-configure.sh -
Make it executable:
chmod +x pcs-multi-cluster-login-configure.sh -
Run the script:
./pcs-multi-cluster-login-configure.sh --cluster-identifiercluster-name
Cluster interaction environments
After successful configuration, the script generates a cluster-specific activation script in
the current directory. The script has the name
activate-pcs-. The activation script
configures the necessary environment variables and paths to interact with the target
cluster.cluster-name
To activate a cluster environment
-
Use the
sourcecommand to run the activation scriptsource ./activate-pcs-cluster-name# Activate cluster environment for cluster 'my-cluster' source ./activate-pcs-my-cluster # Now you can use Slurm commands sinfo squeue sbatch my-job.sh
What the activation script does
-
Sets the
SLURM_CONFenvironment variable to point to the cluster's configuration. -
Updates the
PATHto include the cluster's Slurm binaries. -
Configures other necessary Slurm environment variables (
MANPATH,LD_LIBRARY_PATH). -
Sets AWS PCS cluster identification variables.
-
Enables seamless interaction with the target AWS PCS cluster.
To deactivate a cluster environment
-
Run the deactivation command.
deactivate-pcs-cluster-name# After activating a cluster source ./activate-pcs-my-cluster # Work with the cluster sinfo # Deactivate when done deactivate-pcs-my-cluster
What the deactivate command does
-
Restores the original
PATHenvironment variable. -
Unsets cluster-specific Slurm environment variables.
-
Returns the shell environment to its pre-activation state.
Note
The activation is session-specific and must be sourced in the shell session where you want to interact with the cluster.