~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/knotless-runner-k8s

0
0
32 lines · 933 B Raw History
#!/usr/bin/env bash
# Runs the PoC against a hosted tenant cluster: obtain a kubeconfig, run
# four steps in a Job, copy outputs back, and print the result.
set -euo pipefail

ROOT=$(cd "$(dirname "$0")/.." && pwd)
OUT=${OUT:-$HOME/.tmp/knotless-runner-k8s}
CLUSTER=${CLUSTER:-knotless-poc}
KUBECONFIG_PATH=$OUT/tenant/$CLUSTER.kubeconfig.yaml

mkdir -p "$OUT/outputs"
if [ ! -s "$KUBECONFIG_PATH" ] || [ "${FORCE_SIGNIN:-0}" = 1 ]; then
  KUBECONFIG_PATH=$(CLUSTER="$CLUSTER" "$ROOT/scripts/tenant-kubeconfig.sh")
fi
export KUBECONFIG=$KUBECONFIG_PATH
kubectl get nodes

cd "$ROOT"
cargo run --quiet -- run \
  --name "$CLUSTER" \
  --runner did:plc:runner \
  --image busybox:1.36 \
  --workdir examples \
  --steps-file examples/steps.tsv \
  --outputs "$OUT/outputs" \
  --result "$OUT/result.json" \
  --log "$OUT/run.log" \
  --timeout 900

echo "result: $OUT/result.json"
echo "log: $OUT/run.log"
echo "outputs: $OUT/outputs"