From time to time, the cluster may require updates. Simlarly, the base images leveraged in Exostellar’s stack may need those same updates.
For certain CVEs where a single sed
command is all that’s required, the user_data.sh
scripts 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.
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.
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:
aws 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 Devices
entry 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:
xli image get -n <ImageName> > image.json |
Update the image.json
file with the new Snpashot-ID.
Send the image.json
file back to the EMS:
xli 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
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.
xli image add -i <AMI-ID> -n <IMAGE_NAME> |
When job completes, update env.json
with new image name.
Backup the original.
cp env0.json env0.json.orig |
Edit the env0.json
file to add the new image name, replacing the previous image name.
Push the updated env0.json
to the EMS:
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_NAME
xli profile update -p ./profile0.json |
NOTE: The intial profile was named profile0.json
in the ${LSF_RC_CONF_DIR}/exostellar/json
folder according to previous steps in this documentation.