# Kubernetes job to run a single iteration of Galacticus
apiVersion: batch/v1
kind: Job
metadata:
  generateName: galacticus-
  labels:
    app: galacticus
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: galacticus
          image: galacticus/galacticus:latest
          command:
            - /usr/local/galacticus/run_galacticus.sh
          env:
            - name: TREE_FILE
              value: "__TREE_FILE__"
              #value: "Tree_UNIT_001_SF10000_d1.hdf5"
            - name: PARAMETER_FILE
              value: "parameters/snapshotExampleMPI_193_Template.xml"
            - name: INPUT_DIRECTORY
              value: "/input"
            - name: OUTPUT_DIRECTORY
              value: "/output"
            - name: OUTPUT_FILE
              value: "__OUTPUT_FILE__"
          volumeMounts:
            - name: output-directory
              mountPath: /output
            - name: input-directory
              mountPath: /input
          resources:
            requests:
              memory: "2Gi"
              cpu: "2"
            limits:
              memory: "2Gi"
              cpu: "2"
      volumes: 
        - name: output-directory
          hostPath:
            path: /efs-ecs/docker/galacticus/output
            type: Directory 
        - name: input-directory
          hostPath:
            path: /efs-ecs/docker/galacticus/input
            type: Directory
