Skip to content

Instantly share code, notes, and snippets.

@ankitg12
Created November 12, 2025 14:34
Show Gist options
  • Select an option

  • Save ankitg12/cf65340ceb5cdc06b7afd5054ccfe320 to your computer and use it in GitHub Desktop.

Select an option

Save ankitg12/cf65340ceb5cdc06b7afd5054ccfe320 to your computer and use it in GitHub Desktop.
Testrunner yaml for agfhc as prestart job
apiVersion: apps/v1
kind: Deployment
metadata:
name: pytorch-gpu-deployment
namespace: default
labels:
purpose: demo-pytorch-amdgpu
spec:
replicas: 1
selector:
matchLabels:
purpose: demo-pytorch-amdgpu
template:
metadata:
labels:
purpose: demo-pytorch-amdgpu
spec:
serviceAccountName: test-run
volumes:
- name: kfd
hostPath:
path: /dev/kfd
type: CharDevice
- name: dri
hostPath:
path: /dev/dri
type: Directory
- name: config-volume
configMap:
name: agfhc-config-map
- hostPath: # Specify to use this directory on the host as volume
path: /var/log/amd-test-runner
type: DirectoryOrCreate
name: test-runner-volume
imagePullSecrets:
- name: amdpsdo
initContainers:
- name: init-test-runner
image: docker.io/amdpsdo/test-runner:agfhc-v1.4.1-9
imagePullPolicy: IfNotPresent
securityContext: # setup security context for container to get access to device related interfaces
privileged: true
volumeMounts:
- mountPath: /dev/dri
name: dri
- mountPath: /dev/kfd
name: kfd
- mountPath: /var/log/amd-test-runner # Specify to mount host path volume into specific directory
name: test-runner-volume
- mountPath: /etc/test-runner/
name: config-volume
resources:
requests:
amd.com/gpu: 1 # requesting all GPUs on the worker node
limits:
amd.com/gpu: 1
env:
- name: TEST_TRIGGER
value: "PRE_START_JOB_CHECK" # Set the TEST_TRIGGER environment variable to PRE_START_JOB_CHECK for test runner as init container
- name: POD_NAME # Use downward API to pass pod name to test runner container
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE # Use downward API to pass pod namespace to test runner container
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NODE_NAME # Use downward API to pass host name to test runner container
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /var/log/amd-test-runner # Specify to mount host path volume into specific directory
name: test-runner-volume
- mountPath: /etc/test-runner/
name: config-volume
containers:
- name: pytorch-gpu-workload
image: busybox:latest
command: ["/bin/sh", "-c", "--"]
args: ["sleep 6000"]
resources:
requests:
amd.com/gpu: 1 # requesting all GPUs on the worker node
limits:
amd.com/gpu: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment