Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Config:
# Set true if you want to use FSx OpenZFS in addition to FSxL.
enable_fsx_openzfs = False

# Set false if you want to disable log rotation of Slurm daemon logs
enable_slurm_log_rotation = True

s3_bucket = "" # required when enable_mount_s3 = True, replace with your actual data bucket name in quotes, ie. "my-dataset-bucket"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ def main(args):
if Config.enable_mount_s3:
ExecuteBashScript("./utils/mount-s3.sh").run(Config.s3_bucket)

if Config.enable_slurm_log_rotation:
ExecuteBashScript("./utils/enable_slurm_log_rotation.sh").run()

print("[INFO]: Success: All provisioning scripts completed")


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

LOGROTATE_CONF_FILEPATH="/etc/logrotate.d/sagemaker-hyperpod-slurm"

echo "[$(hostname)] Adding Slurm log rotation configuration to ${LOGROTATE_CONF_FILEPATH}"

cat <<EOF >>${LOGROTATE_CONF_FILEPATH}
"/var/log/slurm/*.log" {
rotate 2
size 50M
copytruncate
nocompress

missingok
nodelaycompress
nomail
notifempty
noolddir
sharedscripts
postrotate
pkill -x --signal SIGUSR2 slurmctld
pkill -x --signal SIGUSR2 slurmd
pkill -x --signal SIGUSR2 slurmdbd
exit 0
endscript
}
EOF