deploy-infrastructure
Skill484 starsChanged 3 months agoMIT-0View on GitHub
Deploy HyperPod EKS infrastructure using deploy.sh via CloudFormation or Terraform, including AZ resolution, stack outputs, and kubeconfig setup
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architectures/sagemaker-hyperpod-eks/slinky-slurm/AGENTS.mdAGENTS.md
- architectures/sagemaker-hyperpod-eks/terraform-modules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bash-testingSkill
- build-slurm-imageSkill
- deployment-preflightSkill
- deploy-slurm-clusterSkill
- validate-deploymentSkill
- hyperpod-devops-agent-solutionSkill
- hyperpod-incident-rcaSkill
- hyperpod-incident-triageSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use this skill to deploy the HyperPod EKS infrastructure that hosts the Slurm cluster.
- Very specific: line 29
Before running deploy.sh, verify:
- Very specific: line 35
No existing stack with the same name (default: hp-eks-slinky-stack)
- Very specific: line 82
After deploy.sh completes, it writes env_vars.sh containing stack outputs:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy HyperPod EKS Infrastructure
Overview
Use this skill to deploy the HyperPod EKS infrastructure that hosts the Slurm
cluster. This is Phase 1 of the slinky-slurm deployment workflow and must
complete before running setup.sh or install.sh.
The deploy.sh script supports two infrastructure backends:
- CloudFormation (
--infra cfn) -- uses an AWS-hosted S3 template - Terraform (
--infra tf) -- uses local Terraform modules
Deployment takes approximately 20-30 minutes and provisions:
- VPC with public/private subnets
- EKS cluster
- HyperPod instance groups (management + accelerated)
- FSx Lustre file system
- Security groups and IAM roles
Prerequisites
Before running deploy.sh, verify:
- AWS CLI installed and configured with valid credentials
- jq installed (for
--infra cfn) or terraform installed (for--infra tf) - A valid AWS region and AZ ID for instance placement
- No existing stack with the same name (default:
hp-eks-slinky-stack)
See the deployment-preflight skill for detailed prerequisite validation.
Steps
Step 1: Choose instance type and infrastructure backend
Any SageMaker-supported GPU instance type can be used. GPU count, model, and EFA interfaces are auto-discovered via the EC2 API. Two common configurations:
| Instance Type | Count | GPUs | EFA |
ml.g5.8xlarge (default) | 4 | 1 A10G per node | 1 per node |
ml.p5.48xlarge | 2 | 8 H100 per node | 32 per node |
Step 2: Run deploy.sh
CloudFormation path (recommended for first-time users):
# Deploy g5 in us-west-2 (defaults)
bash deploy.sh --instance-type ml.g5.8xlarge --infra cfn
# Deploy p5 in us-east-1 with a specific AZ
bash deploy.sh --instance-type ml.p5.48xlarge --instance-count 2 --infra cfn --region us-east-1 --az-id use1-az2
# Deploy with custom stack name
bash deploy.sh --instance-type ml.g5.8xlarge --infra cfn --stack-name my-slinky-stackTerraform path:
# Deploy g5 using Terraform
bash deploy.sh --instance-type ml.g5.8xlarge --infra tf
# Deploy p5 in us-east-1
bash deploy.sh --instance-type ml.p5.48xlarge --instance-count 2 --infra tf --region us-east-1 --az-id use1-az2The Terraform path will show a plan and prompt for confirmation before applying.
Step 3: Source environment variables
After deploy.sh completes, it writes env_vars.sh containing stack
outputs:
source env_vars.shThis sets:
AWS_ACCOUNT_IDAWS_REGIONEKS_CLUSTER_NAMEVPC_IDPRIVATE_SUBNET_IDSECURITY_GROUP_IDSTACK_ID
Step 4: Update kubeconfig
aws eks update-kubeconfig --name $EKS_CLUSTER_NAME --region $AWS_REGIONStep 5: Verify cluster connectivity
kubectl cluster-info
kubectl get nodesExpected output: nodes with instance types matching the chosen profile
(ml.m5.4xlarge for management, ml.g5.8xlarge or ml.p5.48xlarge for
accelerated).
What deploy.sh Does Internally
CloudFormation Path
- Sources
lib/deploy_helpers.sh - Calls
resolve_instance_profile()to set instance type/count for the profile - Validates AWS credentials via
aws sts get-caller-identity - Resolves AZ IDs for the region via
aws ec2 describe-availability-zones - Validates the specified
--az-idagainst the resolved list - Reads
params.json(40 CloudFormation parameters, g5 defaults) - Calls
resolve_cfn_params()to substitute AZ IDs and instance overrides - Calls
validate_cfn_template()to:- Validate the S3-hosted template is reachable and syntactically valid
via
aws cloudformation validate-template --template-url - Cross-check parameter keys in the resolved params against the template's declared parameters
- Error if required parameters (no default value) are missing
- Warn if extra parameters are provided that the template doesn't expect
- Validate the S3-hosted template is reachable and syntactically valid
via
- Calls
aws cloudformation create-stack(orupdate-stackfor existing stacks) with the S3-hosted HyperPod template - Waits for stack completion (20-30 minutes)
- Extracts outputs to
env_vars.sh
Terraform Path
- Same initial steps (1-5) as CloudFormation
- Copies
custom.tfvarsto the terraform-modules directory - Calls
resolve_tf_vars()to patch region, AZ, and instance overrides - Runs
terraform init,plan, andapply(with user confirmation) - Runs
terraform_outputs.shto extract outputs toenv_vars.sh
Command Reference
Usage: deploy.sh --instance-type <ml.X.Y> --infra <cfn|tf> [OPTIONS]
Required:
--instance-type <type> SageMaker instance type (e.g. ml.g5.8xlarge)
--infra <cfn|tf> Infrastructure deployment method
Optional:
--instance-count <N> Number of accelerated instances (default: 4)
--region <region> AWS region (default: us-west-2)
--az-id <az-id> Availability zone ID (default: usw2-az2)
--stack-name <name> CFN stack name (default: hp-eks-slinky-stack)
--help Show helpVerification
Deployment is successful when:
deploy.shexits with code 0env_vars.shexists and contains all 7 exported variableskubectl get nodesshows nodes in Ready statekubectl cluster-inforeturns the EKS API server endpoint
# Quick verification
source env_vars.sh
echo "Cluster: $EKS_CLUSTER_NAME"
echo "Region: $AWS_REGION"
kubectl get nodes -o wideTroubleshooting
| Symptom | Cause | Fix |
| Stack creation fails with capacity error | AZ doesn't have capacity for the instance type | Try a different --az-id |
ROLLBACK_COMPLETE status | CFN template parameter issue | Check CloudFormation events: aws cloudformation describe-stack-events --stack-name <name> |
| Terraform plan fails | Missing terraform-modules directory | Ensure the full awsome-distributed-ai repo is cloned, not just the slinky-slurm subdirectory |
env_vars.sh not created | Script failed before output extraction | Check the script output for errors and re-run |
| AZ ID validation warning | Specified AZ not in the region | Use one of the AZ IDs shown in the "Available AZs" message |
| Stack already exists | Previous deployment not cleaned up | Run destroy.sh first, or use a different --stack-name |
| Template validation fails | S3-hosted template unreachable or params mismatch | Check network/credentials; review the missing/extra parameter warnings in the output |
References
deploy.sh-- Main infrastructure deployment scriptlib/deploy_helpers.sh-- Helper functions (resolve_instance_profile,resolve_cfn_params,resolve_tf_vars,validate_az_id,validate_cfn_template,check_command)params.json-- CloudFormation parameters (40 params, g5 defaults)custom.tfvars-- Terraform variables (g5 defaults)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

