Compute Cluster Updates Slurm
Compute Cluster Updates
From time to time, the cluster may require updates. Simlarly, the base images leveraged in Exostellar’s stack may need those same updates.
If the Updates are Minimal
For certain CVEs where a single sed command is all that’s required, the user_data.shscripts may suffice. Similarly, instaneous or relatively trivial changes to the image are good candidates for update via user_data.sh. If the additional commands amount to more than a few seconds of per-boot work, it is recommended to use an updated version of the AMI as described below.
If the Updates are More Substantial
At times, required software in the cluster may be introduced that requires significant changes due to new dependencies. When it comes to updates that require more than 10 seconds to realize, it is recommended to leverage an updated version of the AMI and stop using the outdated image asset going forward. The steps below outline the process that will be required.
Fast Option:Replace the Contents of the Updated AMI by Leveraging the Snapshot-ID
- With the AMI-ID, we can query AWS for the Snapshot-ID or we can find it in the AWS Console: - AWS cli query for CentOS7 and Rocky9 AMIs: - CODEaws ec2 describe-images --image-ids <AMI_ID> --query 'Images[0].BlockDeviceMappings[?DeviceName==`/dev/sda1`].Ebs.SnapshotId' --output text
 
- AWS Console : Navigate to updated - EC2 > AMIs > <AMI_ID>and look for the- Block Devicesentry on the page, which contains the snapshot-id embedded in string: “/dev/sda1=snap-007d78a7a00b2dc84:30:true:gp2”.
 
- To swap out the previous Snapshot-ID with the new, first pull down the image information as a JSON object: - CODExli image get -n <ImageName> > image.json
 
- Update the - image.jsonfile with the new Snpashot-ID.
- Send the - image.jsonfile back to the EMS:- CODExli image update -n <ImageName> -p ./image.json
 
- While jobs running will continue to use the previous image, jobs submitted after this point will pick up the new image. 
Longer Option: Add a the New Image as a Subsequent Iteration and Reconfigure
To leave the previous image intact and unchanged, repeat the process for parsing an AMI and then update the environment.
- The AMI-ID should - be based on a slurm compute node from your cluster, capable of running your workloads. 
- be created by this account. 
- not have product codes. 
 
- The Image Name to assign should be unique. 
- CODExli image add -i <AMI-ID> -n <IMAGE_NAME>
- When job completes, update - env.jsonwith new image name.- Backup the original. CODE- cp env0.json env0.json.orig
- Edit the - env0.jsonfile to add the new image name, replacing the previous image name.
 
- Push the updated - env0.jsonto the EMS:CODE- xli env update -p ./env0.json
- If any profile is currently using the image that was just replaced, set that profile to drain so that active jobs run through to completion but new jobs will be routed to fresh assets leveraging the new image. - For any profiles using the old - IMAGE_NAMECODE- xli profile update -p ./profile0.json- NOTE: The intial profile was named - profile0.jsonin the- ${SLURM_CONF_DIR}/exostellar/jsonfolder according to previous steps in this documentation.
 
