Files
homelab/tasks/test.yaml
renovate[bot] 6e65b6b85a Update nvidia/cuda Docker tag to v12.6.1 (#474)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-05 15:00:07 -03:00

65 lines
1.4 KiB
YAML

version: '3'
vars:
CYAN: tput setaf 6
RED: tput setaf 1
YELLOW: tput setaf 3
GREEN: tput setaf 2
BLUE: tput setaf 1
PURPLE: tput setaf 5
BG_B: tput setab 0
BOLD: tput bold
RESET: tput sgr0
CLEAR: tput reset
TESTING_NAMESPACE: default
silent: true
tasks:
clear:
cmds:
- sleep 0.1 && {{.CLEAR}}
highlight_bg:
cmds:
- |
sleep 0.1 && \
{{.CYAN}} && \
{{.BOLD}} && \
{{.BG_B}}
highlight_normal:
cmds:
- |
sleep 0.1 && \
{{.CYAN}} && \
{{.BOLD}}
reset:
cmds:
- |
sleep 0.1 && \
{{.RESET}}
nvidia:
preconditions:
- sh: 'which kubectl'
msg: 'kubectl {{.PATH_ERROR}}'
cmds:
- |
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Pod
metadata:
name: gpu
namespace: {{.TESTING_NAMESPACE}}
spec:
restartPolicy: Never
containers:
- name: gpu
image: "nvidia/cuda:12.6.1-base-ubuntu20.04@sha256:5d012529898dc2dc6f79671e7f77ab48459d7c31a73dff259b274afa80069e9d"
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
resources:
limits:
nvidia.com/gpu: 1
EOF
- kubectl exec -n {{.TESTING_NAMESPACE}} -it gpu -- nvidia-smi
ignore_error: true