global:
  public: false
  vpcId: vpc-043ed6ca2955dd897
  istio:
    enabled: true
  ingress:
    redirectPaths:
    - /metrics
    annotations:
      external-dns.alpha.kubernetes.io/alias: "true"
      external-dns.alpha.kubernetes.io/target: dev-aws.maestro.zooxlabs.com
    redirectAnnotations:
      external-dns.alpha.kubernetes.io/alias: "true"
      external-dns.alpha.kubernetes.io/target: dev-aws.maestro.zooxlabs.com
  jaeger:
    enabled: true
    esUrl: https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com:443
  owners:
  - rfeng
  - jbai
  - zxiu
  - shguo
  - llu

  replicaCount: 3

  services:
    admin-gateway:
      dependencies:
        - mission
        - robot
        - trip
        - user
        - vitals
      ingress:
        enabled: true
        secretName: admin-gateway-tls
        annotations:
          cert-manager.io/cluster-issuer: vault-infra
      build:
        context: dispatch/admin_gateway
      env:
        MICROCOSM_ENVIRONMENT:
          value: dev
        ADMIN_GATEWAY__MISSION_CLIENT__URL:
          value: '"http://mission"'
        ADMIN_GATEWAY__TRIP_CLIENT__URL:
          value: '"http://trip"'
        ADMIN_GATEWAY__ROBOT_CLIENT__URL:
          value: '"http://robot"'
        ADMIN_GATEWAY__DIAGNOSTICS_SERVICE_CLIENT__URL:
          value: '"http://diagnostics"'
        ADMIN_GATEWAY__USER_ZCLIENT__URL:
          value: '"http://user"'
        ADMIN_GATEWAY__HAIL_RESULT_STORE__ES_URL:
          value: "https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com"
        ADMIN_GATEWAY__HAIL_RESULT_STORE__ES_INDEX:
          value: "mission-assignment-daemon"
        MAESTRO_METRICS__METRICS_ENDPOINT:
          value: '"/metrics"'
        prometheus_multiproc_dir:
          value: "/tmp"
      serviceMonitor:
        enabled: true
        port: http
        path: /metrics

    diagnostics:
      build:
        context: dispatch/diagnostics_service
      env:
        # Begin: Diagnostic source configs.
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__HAIL_DEBUG_ES_URL:
          value: "https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com"
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__HAIL_DEBUG_ES_INDEX:
          value: "mission-assignment-daemon"
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__VITALS_GAP_ES_URL:
          value: "https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com"
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__VITALS_GAP_ES_INDEX:
          value: "kubernetes_cluster*"
        DIAGNOSTICS_SERVICE__ROBOT_CLIENT__URL:
          value: http://robot:80
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__VITALS_GAP_THRESHOLD_SECS:
          value: "30"
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__DISPATCH_GAP_ES_URL:
          value: "https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com"
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__DISPATCH_GAP_ES_INDEX:
          value: "kubernetes_cluster*"
        DIAGNOSTICS_SERVICE__DIAGNOSTICS_SERVICE_CONTROLLER__DISPATCH_GAP_THRESHOLD_SECS:
          value: "30"
        # End: Diagnostic source configs.
        DIAGNOSTICS_SERVICE__MISSION_CLIENT__URL:
          value: '"http://mission"'

    geo:
      build:
        context: dispatch/geo
      env:
        GEO__PLANNER_CLIENT__URL:
          value: "http://cloud-planner"

    vitals:
      build:
        context: dispatch/vitals
      env:
        MICROCOSM_ENVIRONMENT:
          value: dev
        VITALS__MISSION_AVAILABILITY_STORE__REDIS_HOST:
          value: redis-master
        VITALS__MISSION_AVAILABILITY_STORE__REDIS_PORT:
          value: "6379"
        VITALS__VITALS_STORE__REDIS_HOST:
          value: redis-master
        VITALS__VITALS_STORE__REDIS_PORT:
          value: "6379"
        VITALS__CELERY_APP__BROKER_URL:
          value: redis://redis-master:6379
        VITALS__CELERY_APP__RESULT_BACKEND:
          value: redis://redis-master:6379

    robot-gateway:
      replicaCount: 5
      dependencies:
        - mission
        - route-smoother
        - trip
        - user
        - vitals
      ingress:
        enabled: true
        secretName: robot-gateway-tls
        annotations:
          cert-manager.io/cluster-issuer: vault-infra
      build:
        context: dispatch/robot_gateway
      env:
        MICROCOSM_ENVIRONMENT:
          value: dev
        ROBOT_GATEWAY__MISSION_CLIENT__URL:
          value: '"http://mission"'
        ROBOT_GATEWAY__PLANNER_ZCLIENT__URL:
          value: '"http://cloud-planner"'
        ROBOT_GATEWAY__ROUTE_SMOOTHER_CLIENT__URL:
          value: '"http://route-smoother"'
        ROBOT_GATEWAY__TRIP_CLIENT__URL:
          value: '"http://trip"'
        ROBOT_GATEWAY__USER_ZCLIENT__URL:
          value: '"http://user"'
        ROBOT_GATEWAY__VITALS_CLIENT__URL:
          value: '"http://vitals"'
        ROBOT_GATEWAY__ROBOT_CLIENT__URL:
          value: '"http://robot"'
        ROBOT_GATEWAY__MICROCOSM_TRACER__JAEGER_CLIENT_CONFIG__SAMPLER:
          value: '{"param":"0.1","type":"probabilistic"}'
        ROBOT_GATEWAY__ROBOT_GATEWAY_CONTROLLER__MISSION_UPDATE_MAX_RETRIES:
          value: "20"
        ROBOT_GATEWAY__ROBOT_GATEWAY_CONTROLLER__MISSION_UPDATE_RETRY_INTERVAL_SECS:
          value: "0.2"
        MAESTRO_METRICS__METRICS_ENDPOINT:
          value: '"/metrics"'
        prometheus_multiproc_dir:
          value: "/tmp"
      serviceMonitor:
        enabled: true
        port: http
        path: /metrics

    robot-gateway-grpc:
      replicaCount: 2
      build:
        context: dispatch
        dockerfile: dispatch/robot_backend/Dockerfile
      env:
        ROBOT_GATEWAY_URL:
          value: http://robot-gateway
        METRICS_PORT:
          value: 8080
      containerPort: 50051
      appProtocol: grpc
      extraPorts:
        - name: metrics
          targetPort: 8080
          servicePort: 8080
      ingress:
        enabled: true
        secretName: robot-gateway-grpc
      readinessProbe:
        exec:
          command: ["/bin/grpc_health_probe", "-addr=:50051"]
        initialDelaySeconds: 5
      livenessProbe:
        exec:
          command: ["/bin/grpc_health_probe", "-addr=:50051"]
        initialDelaySeconds: 10
      serviceMonitor:
        enabled: true
        port: metrics
        path: /

    trip:
      build:
        context: dispatch/trip
      livenessProbe:
        exec:
          command:
          - echo
          - "TODO: add liveness probe"
      readinessProbe:
        exec:
          command:
          - echo
          - "TODO: add readiness probe"
      env:
        DISPATCH_TRIP__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        DISPATCH_TRIP__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        DISPATCH_TRIP__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        DISPATCH_TRIP__POSTGRES__USERNAME:
          value: 'dispatch_trip'
        DISPATCH_TRIP__POSTGRES__DATABASE_NAME:
          value: 'dispatch_trip'
        DISPATCH_TRIP__MICROCOSM_TRACER__JAEGER_CLIENT_CONFIG__SAMPLER:
          value: '{"param":"0.5","type":"probabilistic"}'
      args:
        - migrate-and-run

    predetermined-route:
      build:
        context: dispatch/predetermined_route
      env:
        PREDETERMINED_ROUTE__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        PREDETERMINED_ROUTE__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        PREDETERMINED_ROUTE__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        PREDETERMINED_ROUTE__POSTGRES__USERNAME:
          value: 'dispatch_predetermined_route'
        PREDETERMINED_ROUTE__POSTGRES__DATABASE_NAME:
          value: 'dispatch_predetermined_route'
      args:
        - migrate-and-run

    user:
      build:
        context: dispatch/user
      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      env:
        ZOOX_DISPATCH_USER__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        ZOOX_DISPATCH_USER__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        ZOOX_DISPATCH_USER__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        ZOOX_DISPATCH_USER__AUTH0_API__CLIENT_ID:
          valueFrom:
            secretKeyRef:
              name: auth0
              key: CLIENT_ID
        ZOOX_DISPATCH_USER__AUTH0_API__CLIENT_SECRET:
          valueFrom:
            secretKeyRef:
              name: auth0
              key: CLIENT_SECRET
        MICROCOSM_ENVIRONMENT:
          value: dev
        ZOOX_DISPATCH_USER__POSTGRES__USERNAME:
          value: 'zoox_dispatch_user'
        ZOOX_DISPATCH_USER__POSTGRES__DATABASE_NAME:
          value: 'zoox_dispatch_user'
        ZOOX_DISPATCH_USER__ZOOX_DISPATCH_USER_CONTROLLER__DEFAULT_HAIL_MODE:
          value: 'FIXED'
      args:
        - migrate-and-run
    maestro-cron:
      livenessProbe:
        exec:
          command:
          - echo
          - "TODO: add liveness probe"
      readinessProbe:
        exec:
          command:
          - echo
          - "TODO: add readiness probe"
      build:
        context: dispatch/maestro_cron
      env:
        CELERY_APP__BROKER_URL:
          value: redis://redis-master:6379
        CELERY_APP__RESULT_BACKEND:
          value: redis://redis-master:6379
        MAESTRO_CRON__ROBOT_CLIENT__URL:
          value: 'http://robot'
        MAESTRO_CRON__USER_CLIENT__URL:
          value: 'http://user'
    robot:
      dependencies:
        - user
      build:
        context: dispatch/robot
      env:
        MICROCOSM_ENVIRONMENT:
          value: dev
        ROBOT__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        ROBOT__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        ROBOT__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        ROBOT__POSTGRES__USERNAME:
          value: 'maestro_robot'
        ROBOT__POSTGRES__DATABASE_NAME:
          value: 'maestro_robot'
        ROBOT__USER_CLIENT__URL:
          value: 'http://user'
      args:
        - migrate-and-run

    robot-sims:
      build:
        context: dispatch/robot_sims
      dependencies:
        - robot-gateway
        - cloud-planner
      livenessProbe:
        exec:
          command:
          - echo
          - "TODO: add liveness probe"
      readinessProbe:
        exec:
          command:
          - echo
          - "TODO: add readiness probe"
      env:
        ROBOT_SIMS_DAEMON__ROBOT_SIM__URL:
          value: http://robot-gateway
        ROBOT_SIMS_DAEMON__LOGGING__LEVEL:
          value: "ERROR"
        ROBOT_SIMS_DAEMON__PLANNER_ZCLIENT__URL:
          value: http://cloud-planner
        ROBOT_SIMS_DAEMON__ROBOT_SIM__SPEED_FACTOR:
          value: "10"
        ROBOT_SIMS_DAEMON_RUNNER__ROBOT_SIMS_DAEMON__PROCESSES:
          value: '"60"'
      replicaCount: 0

    robot-sims-v2:
      build:
        context: dispatch
        dockerfile: dispatch/robot_sims_v2/Dockerfile
      ingress:
        enabled: true
      dependencies:
        - robot-gateway
        - cloud-planner
        - admin-gateway
        - robot-gateway-grpc
      logger:
        directory:  /var/log/celery
        logs:
        - name: "celery"
          file: "celery.log"

      livenessProbe:
        exec:
          command:
          - echo
          - "TODO: add liveness probe"
      readinessProbe:
        exec:
          command:
          - echo
          - "TODO: add readiness probe"
      env:
        ROBOT_SIMS_V2__PLANNER_CLIENT__URL:
          value: http://cloud-planner
        ROBOT_SIMS_V2__ROBOT_GATEWAY_CLIENT__URL:
          value: http://robot-gateway
        ROBOT_SIMS_V2__ROBOT_GATEWAY_GRPC_CLIENT__URL:
          value: robot-gateway-grpc
        ROBOT_SIMS_V2__ROBOT_GATEWAY_GRPC_CLIENT__PORT:
          value: '80'
        ROBOT_SIMS_V2__ADMIN_GATEWAY_CLIENT__URL:
          value: http://admin-gateway
        ROBOT_SIMS_V2__LOGGING__LEVEL:
          value: "ERROR"
        ROBOT_SIMS_V2__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        ROBOT_SIMS_V2__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        ROBOT_SIMS_V2__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        ROBOT_SIMS_V2__POSTGRES__DATABASE_NAME:
          value: 'robot_sims_v2'
        ROBOT_SIMS_V2__POSTGRES__USERNAME:
          value: 'robot_sims_v2'
        CELERY_APP__MAX_NUM_PROCESS:
          value: '100'
        CELERY_APP__BROKER_URL:
          value: redis://redis-master:6379
        CELERY_APP__RESULT_BACKEND:
          value: redis://redis-master:6379
        CELERY_APP__RESULT_EXPIRES:
          value: 86400
      args:
        - migrate-and-run

    route-smoother:
      build:
        context: dispatch/route_smoother

      env:
        MICROCOSM_ENVIRONMENT:
          value: dev
        ROUTE_SMOOTHER__MAP_BOX_CLIENT__REDIS_HOST:
          value: '"redis-master"'
        ROUTE_SMOOTHER__MAP_BOX_CLIENT__REDIS_PORT:
          value: '"6379"'
        ROUTE_SMOOTHER__MAP_BOX_CLIENT__TOKEN:
          value: '"pk.eyJ1IjoiZ2xpbnNjb3R0IiwiYSI6IjM2MzZhNWYzZTcyODcwYzc2ZmE2M2M3N2Y5NTRlMzcxIn0.WxlKZk3Bp928DcmQ-3pwEg"'
        ROUTE_SMOOTHER__MICROCOSM_TRACER__JAEGER_CLIENT_CONFIG__SAMPLER:
          value: '{"param":"1","type":"const"}'

    fleetdash:
      ingress:
        enabled: true
        secretName: fleetdash-tls
      build:
        context: dispatch/fleetdash

      env:
        DISPATCH_ADMIN_API_ENDPOINT:
          valueFrom:
            configMapKeyRef:
              key: DISPATCH_ADMIN_API_ENDPOINT
              name: env-vars
        MAPBOX_TOKEN:
          value: pk.eyJ1IjoiZ2xpbnNjb3R0IiwiYSI6IjM2MzZhNWYzZTcyODcwYzc2ZmE2M2M3N2Y5NTRlMzcxIn0.WxlKZk3Bp928DcmQ-3pwEg

    session:
      build:
        context: dispatch/session
      env:
        MICROCOSM_ENVIRONMENT:
          value: dev
        ZOOX_DISPATCH_SESSION__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        ZOOX_DISPATCH_SESSION__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        ZOOX_DISPATCH_SESSION__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        ZOOX_DISPATCH_SESSION__POSTGRES__USERNAME:
          value: 'zoox_dispatch_session'
        ZOOX_DISPATCH_SESSION__POSTGRES__DATABASE_NAME:
          value: 'zoox_dispatch_session'
      args:
        - migrate-and-run

    mission:
      build:
        context: dispatch/mission_service
      env:
        MISSION_SERVICE__POSTGRES__HOST:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: ENDPOINT_ADDRESS
        MISSION_SERVICE__POSTGRES__PASSWORD:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: MASTER_PASSWORD
        MISSION_SERVICE__POSTGRES__PORT:
          valueFrom:
            secretKeyRef:
              name: postgresql-rds
              key: PORT
        MISSION_SERVICE__POSTGRES__USERNAME:
          value: 'mission'
        MISSION_SERVICE__POSTGRES__DATABASE_NAME:
          value: 'mission'
        MISSION_SERVICE__SESSION_FACTORY__ISOLATION_LEVEL:
          value: 'READ_COMMITTED'
        MISSION_SERVICE__SNS_TOPIC_ARNS__MAPPINGS:
          valueFrom:
            secretKeyRef:
              name: sns-mission
              key: MISSION_SERVICE__SNS_TOPIC_ARNS__MAPPINGS
        AWS_ACCESS_KEY_ID:
          valueFrom:
            secretKeyRef:
              name: sns-mission
              key: SNS_AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY:
          valueFrom:
            secretKeyRef:
              name: sns-mission
              key: SNS_AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION:
          value: us-west-2
        MISSION_SERVICE__GEO_CLIENT__URL:
          value: http://geo
        MISSION_SERVICE__PLANNER_CLIENT__URL:
          value: http://cloud-planner
      sns:
        create: true
        microcosmSecretMapping:
          key: application/vnd.zoox.pubsub._.created.mission
          envName: MISSION_SERVICE__SNS_TOPIC_ARNS__MAPPINGS
      args:
        - migrate-and-run

    mission-assignment-daemon:
      build:
        context: dispatch/mission_assignment_daemon
      dependencies:
        - mission
        - robot
        - cloud-planner
        - trip
        - user
        - vitals
      livenessProbe:
        exec:
          command:
          - echo
          - "TODO: add liveness probe"
      readinessProbe:
        exec:
          command:
          - echo
          - "TODO: add readiness probe"
      sqs:
        create: true
        subscribeTo: sns-mission

      env:
        MISSION_ASSIGNMENT_DAEMON__VITALS_CLIENT__REDIS_HOST:
          value: '"redis-master"'
        MISSION_ASSIGNMENT_DAEMON__VITALS_CLIENT__REDIS_PORT:
          value: '"6379"'
        MISSION_ASSIGNMENT_DAEMON__VITALS_SERVICE_CLIENT__URL:
          value: http://vitals
        MISSION_ASSIGNMENT_DAEMON__VITALS_ZCLIENT__URL:
          value: http://vitals
        MISSION_ASSIGNMENT_DAEMON__VITALS_CLIENT__URL:
          value: http://vitals
        MISSION_ASSIGNMENT_DAEMON__MAESTRO_LOCATION_OPTIMIZER__MAX_DISTANCE_METERS_TO_SNAP_TO_ROBOT_LOCATION:
          value: '30'
        MISSION_ASSIGNMENT_DAEMON__ASSIGN_MISSION_HANDLER__ASSIGN_ON_PATH_PLANNER_FAIL:
          value: 'false'
        MISSION_ASSIGNMENT_DAEMON__MISSION_CLIENT__URL:
          value: http://mission
        MISSION_ASSIGNMENT_DAEMON__MISSION_ZCLIENT__URL:
          value: http://mission
        MISSION_ASSIGNMENT_DAEMON__PLANNER_CLIENT__URL:
          value: http://cloud-planner
        MISSION_ASSIGNMENT_DAEMON__PLANNER_ZCLIENT__URL:
          value: http://cloud-planner
        MISSION_ASSIGNMENT_DAEMON__DIAGNOSTICS_CLIENT__URL:
          value: http://diagnostics
        MISSION_ASSIGNMENT_DAEMON__TRIP_CLIENT__URL:
          value: http://trip
        MISSION_ASSIGNMENT_DAEMON__TRIP_ZCLIENT__URL:
          value: http://trip
        MISSION_ASSIGNMENT_DAEMON__USER_CLIENT__URL:
          value: http://user
        MISSION_ASSIGNMENT_DAEMON__ROBOT_CLIENT__URL:
          value: http://robot
        MISSION_ASSIGNMENT_DAEMON__HAIL_RESULT_STORE__ES_URL:
          value: "https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com"
        MISSION_ASSIGNMENT_DAEMON__HAIL_RESULT_STORE__ES_INDEX:
          value: "mission-assignment-daemon"
        MISSION_ASSIGNMENT_DAEMON__ASSIGN_MISSION_HANDLER__MISSION_UPDATE_MAX_RETRIES:
          value: '5'
        MISSION_ASSIGNMENT_DAEMON__ASSIGN_MISSION_HANDLER__MISSION_UPDATE_RETRY_INTERVAL_SECS:
          value: '0.1'
        MISSION_ASSIGNMENT_DAEMON__ROBOT_IMPL__RANGE_METERS:
          value: '10000'
        MISSION_ASSIGNMENT_DAEMON__SQS_CONSUMER__SQS_QUEUE_URL:
          valueFrom:
            secretKeyRef:
              name: sqs-mission-assignment-daemon
              key: QUEUE_URL
        AWS_ACCESS_KEY_ID:
          valueFrom:
            secretKeyRef:
              name: sqs-mission-assignment-daemon
              key: SQS_AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY:
          valueFrom:
            secretKeyRef:
              name: sqs-mission-assignment-daemon
              key: SQS_AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION:
          value: us-west-2

    cloud-planner:
      build:
        type: bazel
        context: dispatch/cloud_planner
        target: "//dispatch/cloud_planner:push_server_image"
        resources: {}
      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      env:
        # use the default containerPort
        SERVER_PORT:
          value: '80'
        ZRN_NAMES:
          value: '["sf", "testing/altamont", "testing/demo/chess_parking_lot_bidi"]'
        ENABLED_RELEASE_STATUSES:
          value: '["kReleased", "kPointToPoint"]'
        DEFAULT_RELEASE_STATUS:
          value: "kReleased"
        MAX_SNAP_RADIUS_METERS:
          value: '350'
      serviceMonitor:
        enabled: true
        port: http
        path: /metrics
        scrapeTimeout: 30s

    mobile-gateway:
      dependencies:
        - geo
        - mission
        - predetermined-route
        - robot
        - route-smoother
        - session
        - trip
        - user
      ingress:
        enabled: true
        secretName: mobile-gateway-tls
      build:
        context: dispatch/mobile_gateway
      env:
        MICROCOSM_ENVIRONMENT:
          value: "dev"
        MOBILE_GATEWAY__MICROCOSM_TRACER__JAEGER_CLIENT_CONFIG__SAMPLER:
          value: '{"param":"1","type":"const"}'
        MOBILE_GATEWAY__MISSION_CLIENT__URL:
          value: '"http://mission"'
        MOBILE_GATEWAY__PLANNER_CLIENT__URL:
          value: '"http://cloud-planner"'
        MOBILE_GATEWAY__PREDETERMINED_ROUTE_CLIENT__URL:
          value: '"http://predetermined-route"'
        MOBILE_GATEWAY__ROBOT_CLIENT__VITALS_AGE_THRESHOLD_TO_USE_FOR_YAW_MS:
          value: '0'
        MOBILE_GATEWAY__ROUTE_SMOOTHER_CLIENT__URL:
          value: '"http://route-smoother"'
        MOBILE_GATEWAY__SESSION_CLIENT__URL:
          value: '"http://session"'
        MOBILE_GATEWAY__TRIP_CLIENT__URL:
          value: '"http://trip"'
        MOBILE_GATEWAY__USER_CLIENT__URL:
          value: '"http://user"'
        MOBILE_GATEWAY__GEO_CLIENT__URL:
          value: '"http://geo"'
        MOBILE_GATEWAY__ROBOT_CLIENT__URL:
          value: '"http://robot"'
        MOBILE_GATEWAY__SERVICE_AREA_CLIENT__URL:
          value: '"http://service-area-data"'
        MOBILE_GATEWAY__HAIL_RESULT_STORE__ES_URL:
          value: '"https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com"'
        MOBILE_GATEWAY__HAIL_RESULT_STORE__ES_INDEX:
          value: '"mission-assignment-daemon"'
        MOBILE_GATEWAY__MOBILE_CLIENT_GATEWAY_CONTROLLER__MISSION_UPDATE_MAX_RETRIES:
          value: '20'
        MOBILE_GATEWAY__MOBILE_GATEWAY_CONTROLLER__MISSION_UPDATE_RETRY_INTERVAL_SECS:
          value: '0.2'
        MOBILE_GATEWAY__AUTH_DECORATORS__AUTH_DOMAIN:
          value: '"https://mobile-gateway.dev.maestro.zoox.com"'
        MOBILE_GATEWAY__AUTH_DECORATORS__API_AUDIENCE:
          value: '"https://mobile-gateway.dev.maestro.zoox.com"'
        MAESTRO_METRICS__METRICS_ENDPOINT:
          value: '"/metrics"'
        prometheus_multiproc_dir:
          value: "/tmp"
      serviceMonitor:
        enabled: true
        port: http
        path: /metrics
        scrapeTimeout: 30s

    stale-mission:
      build:
        context: dispatch/stale_mission
      dependencies:
        - mission
      livenessProbe:
        exec:
          command:
          - echo
          - "TODO: add liveness probe"
      readinessProbe:
        exec:
          command:
          - echo
          - "TODO: add readiness probe"
      sqs:
        create: true
        subscribeTo: sns-mission
      env:
        STALE_MISSION_DAEMON__MISSION_CLIENT__URL:
          value: http://mission
        STALE_MISSION_DAEMON__STALE_MISSION_HANDLER__STALE_THRESHOLD_SECONDS:
          value: "14400"
        STALE_MISSION_DAEMON__STALE_MISSION_HANDLER__REQUESTED_STATUS_STALE_THRESHOLD_SECONDS:
          value: "120"
        STALE_MISSION_DAEMON__SQS_CONSUMER__SQS_QUEUE_URL:
          valueFrom:
            secretKeyRef:
              name: sqs-stale-mission
              key: QUEUE_URL
        AWS_ACCESS_KEY_ID:
          valueFrom:
            secretKeyRef:
              name: sqs-stale-mission
              key: SQS_AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY:
          valueFrom:
            secretKeyRef:
              name: sqs-stale-mission
              key: SQS_AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION:
          value: us-west-2

    service-area-data:
      build:
        type: bazel
        context: dispatch/service_area_data
        target: "//dispatch/service_area_data:push_server_image"
        resources: {}
      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      env:
        # use the default containerPort
        SERVER_PORT:
          value: '80'

zoox-base:
  enabled: true

sqs-sns:
  enabled: false

ci-pipeline:
  enabled: false

  build:
    resources:
      requests:
        ephemeral-storage: 2560Mi
      limits:
        ephemeral-storage: 5Gi

  integrationTest:
    enabled: true
    image: dockerhub.docker.zooxlabs.com/python:3.6.10-slim
    workingDir: dispatch/maestro_integration_tests
    script: |
      #!/bin/bash

      set -ex

      pip --default-timeout=60 install --no-cache-dir -r requirements.txt
      pip check
      pytest --branch=$(params.env) --threads=1 --namespace=$(params.env)

redis:
  enabled: true
  nameOverride: redis
  fullnameOverride: redis

  usePassword: false

  metrics:
    enabled: true
    serviceMonitor:
      enabled: true

  cluster:
    enabled: false

postgresql:
  enabled: false

  image:
    tag: "9.6"

  nameOverride: postgresql
  fullnameOverride: postgresql

  postgresqlUsername: postgres
  postgresqlPassword: secret

rds:
  enabled: false
  fullnameOverride: postgresql-rds
  CidrBlocks: "" # e.g. 10.5.128.0/28,10.5.128.16/28
  MasterUsername: postgres
  MultiAZ: "false"

prometheus-pushgateway:
  enabled: true

telemetry:
  enabled: false


prep-dbs:
  env:
    MASTER_PASSWORD:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: MASTER_PASSWORD
    ENDPOINT_ADDRESS:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: ENDPOINT_ADDRESS
    PORT:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: PORT
init-dbs:
  env:
    DB_NAMES:
      value: "dispatch_predetermined_route zoox_dispatch_user zoox_dispatch_session dispatch_trip mission maestro_robot robot_sims_v2"
    ENDPOINT_ADDRESS:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: ENDPOINT_ADDRESS
    MASTER_PASSWORD:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: MASTER_PASSWORD
    MASTER_USERNAME:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: MASTER_USERNAME
    PORT:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: PORT
    DB_NAME:
      valueFrom:
        secretKeyRef:
          name: postgresql-rds
          key: DB_NAME
