diff --git a/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/lifecycle_script.py b/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/lifecycle_script.py index 5da51d4c..0ac0eadb 100644 --- a/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/lifecycle_script.py +++ b/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/lifecycle_script.py @@ -160,6 +160,8 @@ def main(args): print("This is a slurm cluster. Do additional slurm setup") self_ip = get_ip_address() + head_node_ip = resource_config.get_list_of_addresses(params.controller_group) + login_node_ip = resource_config.get_list_of_addresses(params.login_group) print(f"This node ip address is {self_ip}") group, instance = resource_config.find_instance_by_address(self_ip) @@ -177,7 +179,7 @@ def main(args): ExecuteBashScript("./setup_mariadb_accounting.sh").run() ExecuteBashScript("./apply_hotfix.sh").run(node_type) - ExecuteBashScript("./utils/motd.sh").run(node_type) + ExecuteBashScript("./utils/motd.sh").run(node_type, ",".join(head_node_ip), ",".join(login_node_ip)) ExecuteBashScript("./utils/fsx_ubuntu.sh").run() ExecuteBashScript("./start_slurm.sh").run(node_type, ",".join(controllers)) diff --git a/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils/motd.sh b/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils/motd.sh index c436cf23..9b60f052 100644 --- a/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils/motd.sh +++ b/1.architectures/5.sagemaker-hyperpod/LifecycleScripts/base-config/utils/motd.sh @@ -9,4 +9,6 @@ instance_type=$(curl -H "X-aws-ec2-metadata-token: $token" -v http://169.254.169 GREEN="\e[32m" ENDCOLOR="\e[0m" echo -e "You're on the ${GREEN}$1${ENDCOLOR}" | sudo tee -a /etc/motd +echo -e "Controller Node IP: ${GREEN}$2${ENDCOLOR}" | sudo tee -a /etc/motd +echo -e "Login Node IP: ${GREEN}$3${ENDCOLOR}" | sudo tee -a /etc/motd echo -e "Instance Type: ${GREEN}ml.${instance_type}${ENDCOLOR}" | sudo tee -a /etc/motd \ No newline at end of file