Skip to content

Commit

Permalink
feat: add labels at the podMetadata level TDE-1249 (#724)
Browse files Browse the repository at this point in the history
#### Motivation

Managing pod labels helps to do some kind of filtering/analytics on the
pod runs and improve logging information.

#### Modification

- populates the pod labels using `podMetadata` at the workflow spec
level. Workflow `templates` that are called, get their pods to get these
labels too.

#### Checklist

- [ ] Tests updated - no tests - but ran manual ones
- [ ] Docs updated - no docs
- [X] Issue linked in Title
  • Loading branch information
paulfouquet authored Aug 27, 2024
1 parent 253853a commit f0bef77
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 1 deletion.
3 changes: 3 additions & 0 deletions workflows/basemaps/create-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
linz.govt.nz/category: basemaps
spec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: basemaps
arguments:
parameters:
- name: version_basemaps_cli
Expand Down
4 changes: 4 additions & 0 deletions workflows/basemaps/create-overview-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ spec:
nodeSelector:
karpenter.sh/capacity-type: 'spot'
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: raster
arguments:
parameters:
- name: version_basemaps_cli
Expand Down
4 changes: 4 additions & 0 deletions workflows/basemaps/create-overview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
linz.govt.nz/data-type: raster
spec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: raster
arguments:
parameters:
- name: version_basemaps_cli
Expand Down
8 changes: 7 additions & 1 deletion workflows/basemaps/imagery-import-cogify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ spec:
expression: workflow.parameters.ticket
linz.govt.nz/region:
expression: workflow.parameters.region
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: raster
linz.govt.nz/ticket: '{{workflow.parameters.ticket}}'
linz.govt.nz/region: '{{workflow.parameters.region}}'
arguments:
parameters:
- name: version_basemaps_cli
Expand Down Expand Up @@ -75,7 +81,7 @@ spec:
- name: source
description: Source imagery location "s3://linz-imagery"
value: 's3://linz-imagery-staging/test/sample/'

- name: require_stac_collection
description: Validate that a STAC collection.json exists with the source
value: 'true'
Expand Down
5 changes: 5 additions & 0 deletions workflows/basemaps/mapsheet-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ metadata:
linz.govt.nz/data-sub-type: maps
spec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: raster
linz.govt.nz/data-sub-type: maps
arguments:
parameters:
- name: version_argo_tasks
Expand Down
4 changes: 4 additions & 0 deletions workflows/basemaps/vector-etl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ metadata:
linz.govt.nz/data-type: vector
spec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: vector
arguments:
parameters:
- name: version_argo_tasks
Expand Down
3 changes: 3 additions & 0 deletions workflows/cron/cron-stac-validate-fast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
suspend: false
workflowSpec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: stac
arguments:
parameters:
- name: checksum_assets
Expand Down
3 changes: 3 additions & 0 deletions workflows/cron/cron-stac-validate-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
suspend: false
workflowSpec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: stac
arguments:
parameters:
- name: version_argo_tasks
Expand Down
4 changes: 4 additions & 0 deletions workflows/cron/cron-vector-etl-roads-addressing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ spec:
failedJobsHistoryLimit: 3
suspend: false
workflowSpec:
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: vector
workflowTemplateRef:
name: basemaps-vector-etl
arguments:
Expand Down
4 changes: 4 additions & 0 deletions workflows/cron/cron-vector-etl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ spec:
failedJobsHistoryLimit: 3
suspend: false
workflowSpec:
podMetadata:
labels:
linz.govt.nz/category: basemaps
linz.govt.nz/data-type: vector
workflowTemplateRef:
name: basemaps-vector-etl
arguments:
Expand Down
6 changes: 6 additions & 0 deletions workflows/raster/copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ spec:
expression: workflow.parameters.ticket
linz.govt.nz/region:
expression: workflow.parameters.region
podMetadata:
labels:
linz.govt.nz/category: raster
linz.govt.nz/data-type: raster
linz.govt.nz/ticket: '{{workflow.parameters.ticket}}'
linz.govt.nz/region: '{{workflow.parameters.region}}'
arguments:
parameters:
- name: version_argo_tasks
Expand Down
6 changes: 6 additions & 0 deletions workflows/raster/publish-odr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ spec:
expression: workflow.parameters.ticket
linz.govt.nz/region:
expression: workflow.parameters.region
podMetadata:
labels:
linz.govt.nz/category: raster
linz.govt.nz/data-type: raster
linz.govt.nz/ticket: '{{workflow.parameters.ticket}}'
linz.govt.nz/region: '{{workflow.parameters.region}}'
arguments:
parameters:
- name: version_argo_tasks
Expand Down
6 changes: 6 additions & 0 deletions workflows/raster/standardising.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ spec:
expression: workflow.parameters.ticket
linz.govt.nz/region:
expression: workflow.parameters.region
podMetadata:
labels:
linz.govt.nz/category: raster
linz.govt.nz/data-type: raster
linz.govt.nz/ticket: '{{workflow.parameters.ticket}}'
linz.govt.nz/region: '{{workflow.parameters.region}}'
arguments:
parameters:
- name: version_argo_tasks
Expand Down
4 changes: 4 additions & 0 deletions workflows/raster/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
podGC:
strategy: OnPodCompletion # Delete pod once its finished
entrypoint: test-script
podMetadata:
labels:
linz.govt.nz/category: test
linz.govt.nz/data-type: raster
arguments:
parameters:
- name: version_topo_imagery
Expand Down
3 changes: 3 additions & 0 deletions workflows/stac/stac-validate-parallel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ spec:
nodeSelector:
karpenter.sh/capacity-type: 'spot'
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: stac
arguments:
parameters:
- name: version_argo_tasks
Expand Down
3 changes: 3 additions & 0 deletions workflows/test/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
linz.govt.nz/category: test
spec:
entrypoint: env
podMetadata:
labels:
linz.govt.nz/category: test
templates:
- name: env
container:
Expand Down
3 changes: 3 additions & 0 deletions workflows/test/flatten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ spec:
nodeSelector:
karpenter.sh/capacity-type: 'spot'
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: test
arguments:
parameters:
- name: version_argo_tasks
Expand Down
3 changes: 3 additions & 0 deletions workflows/test/generate-path.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ spec:
nodeSelector:
karpenter.sh/capacity-type: 'spot'
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: test
arguments:
parameters:
- name: version_argo_tasks
Expand Down
3 changes: 3 additions & 0 deletions workflows/test/list.arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
linz.govt.nz/category: test
spec:
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: test
arguments:
parameters:
- name: version_argo_tasks
Expand Down
3 changes: 3 additions & 0 deletions workflows/test/list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
spec:
serviceAccountName: workflow-runner-sa
entrypoint: main
podMetadata:
labels:
linz.govt.nz/category: test
arguments:
parameters:
- name: version_argo_tasks
Expand Down
3 changes: 3 additions & 0 deletions workflows/test/sleep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
linz.govt.nz/category: test
spec:
entrypoint: sleep
podMetadata:
labels:
linz.govt.nz/category: test
templates:
- name: sleep
nodeSelector:
Expand Down

0 comments on commit f0bef77

Please sign in to comment.