Switch to bare pods instead of Job scheduler
Job scheduler likes to restart things and masks the exit code of the underlying
container. Since we don't want to auto-resume, just run a bare pod to handle a
single execution.
#!/bin/bash
-# Run a batch job on the Kubernetes cluster.
+# Run a job on the Kubernetes cluster.
#
# Before running, be sure that:
# - the image is built and available at $IMAGE, below.
@@ -61,18 +61,15 @@ if [ ! -d "${PROJECT_DIR}" ]; then
fi
GCP_PROJECT_ID="$(gcloud config get-value project -q)"
-IMAGE="gcr.io/${GCP_PROJECT_ID}/jiant-sandbox:v3"
+IMAGE="gcr.io/${GCP_PROJECT_ID}/jiant-sandbox:v4"
##
-# Create custom config and create a Kubernetes job.
+# Create custom config and create a Kubernetes pod.
cat <<EOF | kubectl ${MODE} -f -
-apiVersion: batch/v1
-kind: Job
+apiVersion: v1
+kind: Pod
metadata:
name: ${JOB_NAME}
-spec:
- backoffLimit: 0
- template:
spec:
restartPolicy: Never
securityContext:
