nvidia: run advertise-gpumem provisioner under bash (dash rejects pipefail)
First apply of ADR-0016 failed: terraform local-exec defaults to /bin/sh, which on Ubuntu is dash — 'set -euo pipefail' exits 2 before running kubectl. Pin the interpreter to bash. Everything else in the gpumem apply succeeded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
968b2b9c64
commit
ac41e7c017
1 changed files with 3 additions and 1 deletions
|
|
@ -57,7 +57,9 @@ locals {
|
||||||
# unschedulable (extended resource not advertised by any node).
|
# unschedulable (extended resource not advertised by any node).
|
||||||
resource "null_resource" "advertise_gpumem" {
|
resource "null_resource" "advertise_gpumem" {
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = <<-EOT
|
# bash, not the default /bin/sh: dash (Ubuntu sh) rejects `set -o pipefail`
|
||||||
|
interpreter = ["/bin/bash", "-c"]
|
||||||
|
command = <<-EOT
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
for node in $(kubectl get nodes -l nvidia.com/gpu.present=true -o jsonpath='{.items[*].metadata.name}'); do
|
for node in $(kubectl get nodes -l nvidia.com/gpu.present=true -o jsonpath='{.items[*].metadata.name}'); do
|
||||||
echo "advertising ${var.gpumem_resource}=${var.gpumem_total_mib} on $node"
|
echo "advertising ${var.gpumem_resource}=${var.gpumem_total_mib} on $node"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue