apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: benchmark-job-id
  labels:
    app: benchmark-ai
    action-id: ACTION_ID
    client-id: CLIENT_ID
    created-by: executor
spec:
  schedule: '*/1 * * * *'
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: benchmark-ai
            action-id: ACTION_ID
            client-id: CLIENT_ID
            created-by: executor
        spec:
          serviceAccountName: scheduled-benchmark
          containers:
          - name: benchmark-starter
            image: benchmarkai/anubis-cron-job
            env:
            - name: KAFKA_BOOTSTRAP_SERVERS
              valueFrom:
                configMapKeyRef:
                  name: outputs-infrastructure
                  key: msk_bootstrap_brokers
            - name: PRODUCER_TOPIC
              valueFrom:
                configMapKeyRef:
                  name: executor
                  key: consumer_topic
            - name: STATUS_TOPIC
              valueFrom:
                configMapKeyRef:
                  name: executor
                  key: status_topic
            - name: BENCHMARK_EVENT
              value: '{"action_id": "ACTION_ID", "parent_action_id": null, "message_id":
                "MESSAGE_ID", "client_id": "CLIENT_ID", "client_version": "CLIENT_VERSION",
                "client_username": "client_username", "authenticated": false, "tstamp":
                42, "visited": [], "type": "BAI_APP_FETCHER", "payload": {"toml":
                {"contents": {"spec_version": "0.1.0", "info": {"task_name": "Hello
                world", "description": " A hello world example of using Benchmark
                AI", "labels": {"custom_label": "my-value", "other_label": "other-value"}},
                "hardware": {"instance_type": "t2.small", "strategy": "single_node"},
                "env": {"docker_image": "edisongustavo/bai-benchmarks-hello-world:latest",
                "vars": {"FIST_VAL": "VAR", "SECOND_VAL": "VAR", "FOO": "bar"}}, "ml":
                {"benchmark_code": "python3 hello-world.py"}, "output": {"metrics":
                [{"name": "accuracy", "units": "%", "pattern": "accuracy=([-+]?\\d*\\.\\d+|\\d+)"},
                {"name": "throughput", "units": "images/sec", "pattern": "throughput=([-+]?\\d*\\.\\d+|\\d+)"}]}},
                "doc": "doc", "sha1": "SHA1", "descriptor_filename": null, "verified":
                false}, "datasets": [], "models": [], "scripts": []}}'
            volumeMounts: []
          nodeSelector:
            node.type: bai-services-cheap
          restartPolicy: Never
          initContainers: []
          volumes: []
