apiVersion: batch/v1
kind: Job
metadata:
  name: hungarian-job
  labels:
    jobgroup: gae-train-job
spec:
  template:
    spec:
      containers:
      - name: postprocessing
        image: gitlab-registry.nautilus.optiputer.net/stsan9/anomalydetection4jets:latest
        command:
        - "python"
        args:
        - "/opt/repo/GraphAE/code/train_script.py"
        - --mod-name
        - "hungarian_job"
        - --input-dir
        - "/anomalyvol/data/datatest/"
        - --box-num
        - "0"
        - --model
        - "EdgeNet"
        - --batch-size
        - "16"
        - --lr
        - ".001"
        - --loss
        - "hungarian_loss"
        volumeMounts:
        - mountPath: /anomalyvol
          name: anomalyvol-2
        - name: git-repo
          mountPath: /opt/repo
        resources:
          limits:
            memory: 256Gi
            cpu: "1"
            nvidia.com/gpu: "1"
          requests:
            memory: 128Gi
            cpu: "1"
            nvidia.com/gpu: "1"    
      initContainers:
      - name: init-clone-repo
        image: alpine/git
        args:
          - clone
          - --single-branch
          - https://github.com/AnthonyAportela/GraphAE
          - -b
          - main
          - /opt/repo/GraphAE
        volumeMounts:
          - name: git-repo
            mountPath: /opt/repo
      volumes:
      - name: git-repo
        emptyDir: {}
      - name: anomalyvol-2
        persistentVolumeClaim:
          claimName: anomalyvol-2
      restartPolicy: Never
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                - key: gpu-type
                  operator: In
                  values:
                  - 1080Ti
  backoffLimit: 5
