feat(hyperpod-slurm): add prepare_extensions.sh helper for OnInitComplete extensions - #1193
Open
aravneelaws wants to merge 1 commit into
Open
feat(hyperpod-slurm): add prepare_extensions.sh helper for OnInitComplete extensions#1193aravneelaws wants to merge 1 commit into
aravneelaws wants to merge 1 commit into
Conversation
…/README Adds a helper script that stages and uploads the Extensions/ directory contents to S3 for use with HyperPod Slurm cluster creation's OnInitComplete (Custom Setup -> Lifecycle configuration -> None). The script picks which extensions to include (--add-users, --observability, or both), generates shared_users.txt from --users / --uids (or interactively), patches observability/config.json with the provided Amazon Managed Prometheus remote_write URL, patches run_extensions.sh's ENABLE_* flags, and uploads a temp-staged copy so nothing in the repo is mutated. Selects the entrypoint automatically: - --observability alone -> observability/setup_observability.sh (no detect-node or run_extensions.sh uploaded) - --add-users (with or without observability) -> run_extensions.sh (detect-node bundled since add_users.sh needs nodeinfo.json) Includes client-side S3 bucket-name validation, live bucket status checks (owned / other-account / absent / wrong-region) using --expected-bucket-owner, --aws-profile support threaded through every AWS call, and --dry-run for offline verification. Also adds Extensions/README.md briefly describing each extension and documenting the helper script's flags and usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds a helper to prepare and upload the
Extensions/directory to S3 for use with the new HyperPod Slurm cluster creation flow (no-LCS). When creating a cluster and choosing Custom Setup → Lifecycle configuration → None, the console accepts an S3 location containing extension scripts. Assembling that bucket by hand is error-prone (per-extension config files,run_extensions.shtoggles, bucket naming/region rules, IAM), so this PR addsprepare_extensions.shto automate it end-to-end.Changes
1.architectures/5.sagemaker-hyperpod/Extensions/prepare_extensions.shthat:--add-users/--observabilityflags.shared_users.txtfrom--users alice,bob,carol(auto-assigns UIDs from 2001) or from--users+--uids, or from an interactive prompt (matches the UX ofLifecycleScripts/base-config/utils/create_users.sh). Also accepts a pre-made file via--users-file.--amp-url) the Amazon Managed Prometheusremote_writeURL and patchesobservability/config.json.--observabilityalone → uploads onlyobservability/; entrypoint isobservability/setup_observability.sh.--add-usersalone or with--observability→ uploadsdetect-node/+ the selected extension dir(s) + a patchedrun_extensions.sh; entrypoint isrun_extensions.sh.--bucket(existing) or--create-bucket(new; sets versioning + public-access-block).owned/other-account/absent/wrong-region, using--expected-bucket-owner(needed because the 2024 HeadBucket API change now returns metadata for any locatable bucket regardless of ownership).--aws-profilethreaded through every AWS call, plus--dry-runand--yesfor non-interactive use.s3://…entrypoint path to paste into the HyperPod console.1.architectures/5.sagemaker-hyperpod/Extensions/README.mdbriefly describing each of the three extensions and documenting the helper script's flags and usage.Test Plan
Environment:
OnInitComplete)ml.m5.2xlargecontroller +ml.g5.8xlargecomputeTest commands:
Test Results
<3or>63chars, adjacent periods, IP-format, reserved prefixes/suffixes) before any AWS call.--add-users --users alice,bobuploaded the following to the target bucket:--aws-profilecorrectly routes every AWS call to the named profile; preflight prints the caller ARN and account ID so the user can verify before upload.--dry-runprints allawsinvocations without executing them.Checklist
mainbranch.latest).