Skip to content

Commit 5c8e8de

Browse files
Fix(community/slinky): add missing instructions output variable (#5787)
1 parent 99082c0 commit 5c8e8de

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

community/examples/slurm-gke/slurm-gke.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ deployment_groups:
139139
slurm_operator_namespace: $(vars.slurm_namespace)
140140
install_slurm_operator_chart: true
141141
install_slurm_chart: false
142+
outputs: [instructions]
142143

143144
- id: gke_compute_nodeset
144145
source: community/modules/compute/gke-nodeset

community/modules/scheduler/slinky/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ No modules.
167167

168168
| Name | Description |
169169
| ---- | ----------- |
170+
| <a name="output_instructions"></a> [instructions](#output\_instructions) | Instructions on how to connect to the cluster and run basic Slurm commands. |
170171
| <a name="output_slurm_namespace"></a> [slurm\_namespace](#output\_slurm\_namespace) | namespace for the slurm chart |
171172
| <a name="output_slurm_operator_namespace"></a> [slurm\_operator\_namespace](#output\_slurm\_operator\_namespace) | namespace for the slinky operator chart |
172173
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

community/modules/scheduler/slinky/outputs.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,34 @@ output "slurm_operator_namespace" {
3333
helm_release.prometheus
3434
]
3535
}
36+
37+
output "instructions" {
38+
description = "Instructions on how to connect to the cluster and run basic Slurm commands."
39+
value = <<-EOT
40+
To test Slurm functionality, connect to the controller or the login node and use Slurm client commands.
41+
42+
First, get cluster credentials:
43+
gcloud container clusters get-credentials ${local.cluster_name} --location ${local.cluster_location} --project ${local.project_id}
44+
45+
Connect to the controller:
46+
kubectl exec -it statefulsets/slurm-controller --namespace=${var.slurm_namespace} -- bash --login
47+
48+
Connect to the login node (if enabled):
49+
(Note: It may take a few minutes for the LoadBalancer IP to become available)
50+
SLURM_LOGIN_IP="$(kubectl get services -n ${var.slurm_namespace} -l app.kubernetes.io/instance=slurm,app.kubernetes.io/name=login -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}")"
51+
# If using root with SSH authorized keys:
52+
ssh -p 2222 root@$${SLURM_LOGIN_IP}
53+
# Or if SSSD/LDAP is configured:
54+
ssh -p 2222 $${USER}@$${SLURM_LOGIN_IP}
55+
56+
Once connected, you can run:
57+
sinfo
58+
srun hostname
59+
EOT
60+
depends_on = [
61+
helm_release.cert_manager,
62+
helm_release.slurm_operator,
63+
helm_release.slurm,
64+
helm_release.prometheus
65+
]
66+
}

0 commit comments

Comments
 (0)