apiVersion: batch/v1
kind: Job
metadata:
  name: xgboost-test
  labels:
    app: xgboost-synthetic-test
spec:
  backoffLimit: 1
  template:
    metadata:
      annotations:
        # TODO(jlewi): Do we really want to disable sidecar injection
        # in the test? Would it be better to use istio to mimic what happens
        # in notebooks?
        sidecar.istio.io/inject: "false"
      labels:
        app: xgboost-synthetic-test
    spec:
      restartPolicy: Never
      securityContext:
        runAsUser: 0
      initContainers:
      # This init container checks out the source code.
      - command:
        - /usr/local/bin/checkout_repos.sh
        - --repos=kubeflow/examples@$(CHECK_TAG)
        - --src_dir=/src
        name: checkout
        image: gcr.io/kubeflow-ci/test-worker:v20190802-c6f9140-e3b0c4
        volumeMounts:
        - mountPath: /src
          name: src
      containers:
      - name: executing-notebooks
        image: execute-image
        command: ["python3", "execute_notebook.py"]
        workingDir: /src/kubeflow/examples/xgboost_synthetic/testing
        volumeMounts:
        - mountPath: /src
          name: src
      serviceAccount: default-editor
      volumes:
      - name: src
        emptyDir: {}
