---
pipeline:
  name: parWaterSurface_pub_packager
transform:
#  image_pull_secrets: [battelleecology-quay-read-all-pull-secret]
  image: us-central1-docker.pkg.dev/neon-shared-service/neonscience/neon-is-pub-package:v2.0.0
  cmd: ["/bin/bash"]
  stdin:
  - "#!/bin/bash"
  - '# Run third module - pub_packager (using environment variables below as input parameters)'
  - python3 -m pub_packager.pub_packager_main
  env:
    # Environment variables for 1st module: pub_grouper.
    LOG_LEVEL: INFO

    # Environment variables for 3rd module: pub_packager.
    OUT_PATH: "/pfs/out"    
    # ERR_PATH can be changed, it is user specified
    ERR_PATH_PACKAGER: "/pfs/out/errored_datums"
    PRODUCT_INDEX: '3' # input path index of the data product identifier. ALso used for packager.
    PUBLOC_INDEX: '7' # input path index of the pub package location (typically the site)
    DATE_INDEX: '4' # Starting index of date in path (i.e. year index)
    DATE_INDEX_LENGTH: '2' # length of date index for pub package (should be 2 for monthly)
    SORT_INDEX: '10' # File name index corresponding to date field (delimiter = .)
    
  secrets:
    - name: pdr-secret
      mount_path: /var/db_secret

input: 
  pfs: 
    name: DATA_PATH
    repo: parWaterSurface_pub_transformer
    # Glob should be monthly and joined with pub_control to hold pub until month is likely complete
    glob: /*/*/*
parallelism_spec:
  constant: 2
autoscaling: true
resource_requests:
  memory: 700M
  cpu: 1
resource_limits:
  memory: 1.5G
  cpu: 1.8
sidecar_resource_requests:
  memory: 2G
  cpu: 0.3
sidecar_resource_limits:
  memory: 4Gi
  cpu: 1.2
datum_set_spec:
  number: 1
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"
    }  
  ] }
