global:
  vpcId: vpc-043ed6ca2955dd897
  istio:
    enabled: false

  jaeger:
    enabled: false
    esUrl: https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com:443

  ingress:
    annotations:
      external-dns.alpha.kubernetes.io/alias: "true"
      external-dns.alpha.kubernetes.io/target: dev-aws.argus.zooxlabs.com

  services: # see example here: https://git.zooxlabs.com/zooxco/driving/blob/master/infra/helm/zoox-base/values.yaml#L16
    frontend:
      build:
        dockerfile: 'argus/frontend/Dockerfile'
        paths:
        - argus/frontend
        - firmware/emu/trajectory_manager/proto
        - spectrum
        - mapping/zrn/web_viewer/three_zrn
        tagPrefix: dev-

      imageTag: "127" # optional to override the tag

      replicaCount: 1

      env:
        ZRN_VIEWER_SERVER:
          value: http://frontend.zrnwv-prod.svc.cluster.local
        CHUM_TO_JSON_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: CHUM_TO_JSON_CACHING_SERVER
        ARGUS_API_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: ARGUS_API_SERVER
        DEPLOYMENT:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: DEPLOYMENT

      healthChecks: # If these are not implemented or removed your app will killed :)
        livenessProbe:
          httpGet:
            path: /
            port: http
        readinessProbe:
          httpGet:
            path: /
            port: http

      resources:
        limits:
          cpu: 512m
          memory: 512Mi
        requests:
          cpu: 256m
          memory: 256Mi

      ingress:
        enabled: true
        annotations:
          nginx.ingress.kubernetes.io/http2-push-preload: "false"

      nodeSelector:
        zoox.com/subtype: cpu

    chum-to-json:
      build:
        type: bazel
        context: argus/chum_to_json_service
        extraArgs: --config=cuda
        target: "//argus/chum_to_json_service:push_service_image"
        resources: {}

      labels:
        argus.zooxlabs.com/service: chum-to-json

      replicaCount: 1

      containerPort: 8080
      extraPorts:
      - name: "metrics"
        containerPort: 5002

      serviceMonitor:
        enabled: true
        port: metrics
        path: /metrics

      env:
        FLAGS_port:
          value: "8080"
        FLAGS_enable_caching:
          value: "true"
        FLAGS_chum_cache_max_gb:
          value: "100"
        PROMETHEUS_METRICS_PORT:
          value: "5002"

      ingress:
        enabled: true
        secret: true

      volumes:
        - name: nautilus-rw
          cephfs:
            monitors:
            - 10.65.7.203:6789
            - 10.65.7.204:6789
            - 10.65.7.205:6789
            readOnly: true
            user: logs_rw
            secretRef:
              name: ceph-secret
        - name: sun-pcs01
          nfs:
            server: sun-pcs01-nfs.zooxlabs.com
            path: /sun-pcs01
        - name: sun-pcp01
          nfs:
            server: sun-pcpstore01.zooxlabs.com
            path: /sun_pcp01
        - name: sun-tcs01
          hostPath:
            path: /mnt/sun-tcs01

      volumeMounts:
        - name: nautilus-rw
          mountPath: /mnt/nautilus_rw
        - name: nautilus-rw
          readOnly: true
          mountPath: /mnt/nautilus
        - name: sun-pcs01
          mountPath: /mnt/sun-pcs01
        - name: sun-pcp01
          mountPath: /mnt/sun-pcp01
        - name: sun-tcs01
          mountPath: /mnt/sun-tcs01

      nodeSelector:
        beta.kubernetes.io/instance-type: m5d.metal

      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: argus.zooxlabs.com/service
                  operator: In
                  values:
                  - chum-to-json
              topologyKey: topology.kubernetes.io/zone

    chum-to-json-zrn:
      aliasOf: chum-to-json

    chum-to-json-misc:
      aliasOf: chum-to-json

    chum-to-json-quarantine:
      aliasOf: chum-to-json

    chum-to-json-gpu:
      aliasOf: chum-to-json

      resources:
        limits:
         nvidia.com/gpu: "1"

      nodeSelector:
        beta.kubernetes.io/instance-type: g4dn.metal

      tolerations:
      - key: nvidia.com/gpu
        value: "true"
        effect: NoSchedule

    chum-to-json-caching:
      build:
        context: argus/chum_to_json_service/caching_layer

      imageTag: "9" # optional to override the tag

      replicaCount: 1

      env:
        CHUM_TO_JSON_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: CHUM_TO_JSON_SERVER
        CHUM_TO_JSON_GPU_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: CHUM_TO_JSON_GPU_SERVER
        CHUM_TO_JSON_ZRN_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: CHUM_TO_JSON_ZRN_SERVER
        CHUM_TO_JSON_CRITICAL_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: CHUM_TO_JSON_CRITICAL_SERVER
        CHUM_TO_JSON_QUARANTINE_SERVER:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: CHUM_TO_JSON_QUARANTINE_SERVER

      ingress:
        enabled: true

      nodeSelector:
        beta.kubernetes.io/instance-type: m5d.metal

      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app.kubernetes.io/name
                operator: In
                values:
                - chum-to-json-caching
            topologyKey: topology.kubernetes.io/zone

      resources:
        requests:
          ephemeral-storage: "250Gi"
          memory: 1Gi
        # We usually recommend not to specify default resources and to leave this as a conscious
        # choice for the user. This also increases chances charts run on environments with little
        # resources, such as Minikube. If you do want to specify resources, uncomment the following
        # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
        # limits:
        #  cpu: 100m
        #  memory: 128Mi
        #  nvidia.com/gpu: 1 # should only be in `limits`
        # requests:
        #  cpu: 100m
        #  memory: 128Mi

    argus-api:
      build:
        dockerfile: 'argus/api_service/Dockerfile'
        context: argus/api_service

      replicaCount: 1

      env:
        DEPLOYMENT:
          valueFrom:
            configMapKeyRef:
              name: env-vars
              key: DEPLOYMENT

      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /alive
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 30
        successThreshold: 1
        timeoutSeconds: 1
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /alive
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 30
        successThreshold: 1
        timeoutSeconds: 1

      resources:
        limits:
          cpu: 512m
          memory: 512Mi
        requests:
          cpu: 256m
          memory: 256Mi

      ingress:
        enabled: true

      nodeSelector:
        zoox.com/subtype: cpu

zoox-base:
  enabled: true

ci-pipeline:
  enabled: true

  integrationTest:
    enabled: false
    image: dockerhub.docker.zooxlabs.com/cypress/browsers:node12.18.3-chrome87-ff82
    workingDir: "argus/frontend"
    script: |
      #!/bin/bash
      yarn && yarn test:e2e --headless --browser chrome --config baseUrl="http://frontend.$K8S_NAMESPACE.svc.cluster.local",video=true,defaultCommandTimeout=10000


vault-link:
  secrets:
    ceph-secret: true
