Skip to content
Open
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
27 changes: 27 additions & 0 deletions ai-ml/gke-slurm/autopilot/allowlist-synchronizer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_ai_ml_gke_slurm_autopilot_allowlist_synchronizer]

apiVersion: auto.gke.io/v1
kind: AllowlistSynchronizer
metadata:
name: slurm-worker-synchronizer
spec:
projectNumber: PROJECT_NUMBER
bucketName: ALLOWLIST_BUCKET
allowlistPaths:
- allowlists/slurm-worker-allowlist.yaml

# [END gke_ai_ml_gke_slurm_autopilot_allowlist_synchronizer]
44 changes: 44 additions & 0 deletions ai-ml/gke-slurm/autopilot/pv-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_ai_ml_gke_slurm_autopilot_pv_pvc]

apiVersion: v1
kind: PersistentVolume
metadata:
name: PV_NAME
spec:
capacity:
storage: FILESTORE_CAPACITY
accessModes:
- ReadWriteMany
nfs:
path: /FILESTORE_SHARE
server: FILESTORE_IP
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: PVC_NAME
namespace: slurm
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: FILESTORE_CAPACITY
volumeName: PV_NAME
storageClassName: ""

# [END gke_ai_ml_gke_slurm_autopilot_pv_pvc]
89 changes: 89 additions & 0 deletions ai-ml/gke-slurm/autopilot/slurm-worker-allowlist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_ai_ml_gke_slurm_autopilot_allowlist]

apiVersion: auto.gke.io/v1
kind: WorkloadAllowlist
metadata:
name: slurm-worker-allowlist.yaml
annotations:
autopilot.gke.io/no-connect: "true"
exemptions:
- autogke-default-linux-capabilities
- autogke-disallow-privilege
matchingCriteria:
initContainers:
- name: logfile
image: docker.io/library/alpine:latest
command:
- sh
- -c
- |
#!/usr/bin/env sh
# SPDX-FileCopyrightText: Copyright (C) SchedMD LLC.
# SPDX-License-Identifier: Apache-2.0

set -eu

SOCKET="\${SOCKET:-"/tmp/logfile.log"}"

mkdir -v -p "\$(dirname "\$SOCKET")"
rm -f "\$SOCKET"
if ! [ -f "\$SOCKET" ]; then
__TAB__mkfifo -m 777 "\$SOCKET"
fi
while IFS="" read data; do
__TAB__echo "\$data"
done <"\$SOCKET"
env:
- name: SOCKET
volumeMounts:
- mountPath: /var/log/slurm
name: slurm-logfile
containers:
- name: slurmd
image: gcr.io/gke-release/slinky/slurmd:IMAGE_TAG
args:
- -Z
- --conf-server
- '^.*-controller\.[a-zA-Z0-9-]+:6817$'
- --conf
- "^'Features=[a-zA-Z0-9-]+'$"
env:
- name: POD_CPUS
- name: POD_MEMORY
securityContext:
capabilities:
add:
- BPF
- NET_ADMIN
- SYS_ADMIN
- SYS_NICE
privileged: true
volumeMounts:
- mountPath: /etc/slurm
name: slurm-etc
readOnly: true
- mountPath: /var/log/slurm
name: slurm-logfile
- mountPath: /shared
name: shared-dir
volumes:
- name: slurm-etc
- name: slurm-logfile
- name: shared-dir
persistentVolumeClaim: {}

# [END gke_ai_ml_gke_slurm_autopilot_allowlist]
75 changes: 75 additions & 0 deletions ai-ml/gke-slurm/autopilot/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_ai_ml_gke_slurm_autopilot_values]

controller:
slurmctld:
image:
repository: gcr.io/gke-release/slinky/slurmctld
tag: IMAGE_TAG
reconfigure:
image:
repository: gcr.io/gke-release/slinky/slurmctld
tag: IMAGE_TAG

restapi:
replicas: 1
slurmrestd:
image:
repository: gcr.io/gke-release/slinky/slurmrestd
tag: IMAGE_TAG

nodesets:
slinky:
enabled: true
replicas: 1
metadata:
labels:
# The label value must exactly match the name of the WorkloadAllowlist
cloud.google.com/matching-allowlist: slurm-worker-allowlist.yaml
slurmd:
image:
repository: gcr.io/gke-release/slinky/slurmd
tag: IMAGE_TAG
volumeMounts:
- name: shared-dir
mountPath: /shared
resources:
requests:
cpu: "30"
memory: "110Gi"
limits:
cpu: "30"
memory: "110Gi"

# Optional: You can request a specific GKE Compute class
podSpec:
volumes:
- name: shared-dir
persistentVolumeClaim:
claimName: slurm-shared-storage
nodeSelector:
cloud.google.com/compute-class: Performance

loginsets:
slinky:
enabled: true
replicas: 1
login:
image:
repository: gcr.io/gke-release/slinky/login
tag: IMAGE_TAG

# [END gke_ai_ml_gke_slurm_autopilot_values]