jobset:
  apiVersion: jobset.x-k8s.io/v1alpha2
  kind: JobSet
  metadata:
    name: {{ job_name }}
    labels:
      {{ jobset_name_label }}: "{{ job_name }}"
      {{ jobset_userid_label }}: "{{ user_id }}"
      {{ jobset_user_label }}: "{{ user }}"
      {% if accelerator_type %}
      {{ jobset_accelerator_label }}: "{{ accelerator_type }}"
      {{ jobset_num_accelerators_label }}: "{{ num_accelerators }}"
      {% endif %}
      trainy.ai/konduktor-managed: "true"
      parent: "trainy"
    annotations: {}
  spec:
    ttlSecondsAfterFinished: 259200 # 3 days
    replicatedJobs:
    - name: workers
      template:
        spec:
          ttlSecondsAfterFinished: 600 # 5 minutes
          parallelism: {{ num_nodes }}
          completions: {{ num_nodes }}
          backoffLimit: 0
          template: {}
          podFailurePolicy:
            rules:
            - action: FailJob
              onPodConditions:
              - type: ConfigIssue