---
# Not currently used.
pipeline:
  name: troll_cron_daily_and_date_control
transform:
  image: us-central1-docker.pkg.dev/neon-shared-service/neonscience/neon-is-date-cntl:v1.0.0
  env:
    # START_DATE ("YYYY-MM-DD") and END_DATE ("YYYY-MM-DD") indicate the max date range (inclusive) to create the /Y/M/D folder structure
    # If START_DATE is not set (remove line entirely to unset), the start_date and/or the kafka_start_date for each site will be used, as indicated in the site-list json file
    # END_DATE can be set or unset (remove line entirely to unset). If unset, end date will be LAG_DAYS_END ago. 
    LAG_DAYS_END: "2" # Default is 2. Don't go lower than 2.
    START_DATE: "2024-07-29"
    # END_DATE: "2023-08-03"
    OUT_PATH: /pfs/out
    SOURCE_TYPE_AQUATROLL: "aquatroll200"
    SOURCE_TYPE_LEVELTROLL: "leveltroll500"
  cmd:
  - sh
  - "-c"
  - |-
    /bin/bash <<'EOF'
    # Use bash-scrict mode. See http://redsymbol.net/articles/unofficial-bash-strict-mode/
    set -euo pipefail
    IFS=$'\n\t'
    
    # AQUATROLL
    export SOURCE_TYPE=$SOURCE_TYPE_AQUATROLL
    ./cron_daily_and_date_control/populate_site_dates.sh
    
    # LEVELTROLL
    export SOURCE_TYPE=$SOURCE_TYPE_LEVELTROLL
    ./cron_daily_and_date_control/populate_site_dates.sh
    
    EOF
input:
  cross:
  # This cron is the central driver for daily scheduled updates, such as data ingest and metadata loaders.
  - cron:
      name: tick
      spec: "0 7 * * *" # Run at 00:00 MST (07:00 GMT)
      overwrite: true
  - pfs:
      name: SITE_FILE
      repo: troll_site_list
      glob: /site-list.json
resource_requests:
  memory: 100M
  cpu: 1
resource_limits:
  memory: 300M
  cpu: 1.5
sidecar_resource_requests:
  memory: 500M
  cpu: 0.2
autoscaling: true
scheduling_spec:
  node_selector:
    cloud.google.com/gke-ephemeral-storage-local-ssd: "true"
    nodepool.neonscience.org/pipeline: "yes"
    cloud.google.com/gke-spot: "true"
pod_spec: |-
  { "tolerations": [
    {
      "key": "nodepool.neonscience.org/pipeline",
      "operator": "Exists"
    },
    {
      "effect": "NoSchedule",
      "key": "cloud.google.com/gke-spot",
      "operator": "Exists"
    }  
  ] }
