apiVersion: batch/v1
kind: Job
metadata:
  name: simulation-executor-agent
spec:
  parallelism: 2
  template:
    metadata:
      name: simulation-executor-agent-template
    spec:
      containers:
      - name: simulation-executor-agent-container
        image: mcanizo/cloudfmi-distributed-simulation-framework:simulation-executor-agent
        imagePullPolicy: IfNotPresent
        command: ["sh", "-c", "python Simulation_Executor_Agent.py --model_path https://github.com/ikerlan2015/CloudFMI-Distributed-Simulation-Framework/raw/master/Simulation_Executor_Agent/model/Academic_model.fmu"]
        resources:
          limits:
            cpu: "1"
            memory: "1Gi"
          requests:
            cpu: "1"
            memory: "1Gi"
        env:
        - name: POSTGRESQL_IP
          value: "<hostname or IP>"
        - name: POSTGRESQL_PORT
          value: "<db_port>"
        - name: POSTGRESQL_DB_NAME
          value: "<db_name>"
        - name: POSTGRESQL_DB_USER
          value: "<db_user>"
        - name: POSTGRESQL_DB_PASS
          value: "<db_password>"
        - name: MAX_SIMULATION_FAILURES
          value: "2"
        - name: SIMULATION_TIME_OUT
          value: "30"
      restartPolicy: OnFailure
