Skip to content

Commit

Permalink
feat(controller): Add custom metadata support for AnalysisRun. Fixes #…
Browse files Browse the repository at this point in the history
…2740 (#2743)

Add custom metadata support for AnalysisRun

Signed-off-by: lukasz <[email protected]>
  • Loading branch information
lukaszgyg authored May 4, 2023
1 parent 04b1e30 commit f72e565
Show file tree
Hide file tree
Showing 13 changed files with 1,475 additions and 624 deletions.
20 changes: 20 additions & 0 deletions docs/features/analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,26 @@ spec:
limit: 20
```

### Define custom Labels/Annotations for AnalysisRun

If you would like to annotate/label the `AnalysisRun` with the custom labels your can do it by specifying
`analysisRunMetadata` field.

```yaml hl_lines="9 10 11"
kind: Rollout
spec:
...
steps:
- analysis:
templates:
- templateName: my-template
analysisRunMetadata:
labels:
my-custom-label: label-value
annotations:
my-custom-annotation: annotation-value
```

### Measurements Retention for Experiments

If an experiment wants to retain more results of its analysis metrics, it simply needs to specify the
Expand Down
6 changes: 6 additions & 0 deletions docs/features/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ spec:
analyses:
- name : mann-whitney
templateName: mann-whitney
# Metadata which will be attached to the AnalysisRun.
analysisRunMetadata:
labels:
app.service.io/analysisType: smoke-test
annotations:
link.argocd.argoproj.io/external-link: http://my-loggin-platform.com/pre-generated-link

# Anti-affinity configuration between desired and previous ReplicaSet.
# Only one must be specified.
Expand Down
44 changes: 44 additions & 0 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ spec:
x-kubernetes-int-or-string: true
postPromotionAnalysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down Expand Up @@ -210,6 +221,17 @@ spec:
type: object
prePromotionAnalysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down Expand Up @@ -297,6 +319,17 @@ spec:
type: integer
analysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down Expand Up @@ -430,6 +463,17 @@ spec:
properties:
analysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down
44 changes: 44 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11387,6 +11387,17 @@ spec:
x-kubernetes-int-or-string: true
postPromotionAnalysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down Expand Up @@ -11444,6 +11455,17 @@ spec:
type: object
prePromotionAnalysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down Expand Up @@ -11531,6 +11553,17 @@ spec:
type: integer
analysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down Expand Up @@ -11664,6 +11697,17 @@ spec:
properties:
analysis:
properties:
analysisRunMetadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
args:
items:
properties:
Expand Down
24 changes: 24 additions & 0 deletions pkg/apiclient/rollout/rollout.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,26 @@
},
"title": "AnalysisRunArgument argument to add to analysisRun"
},
"github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AnalysisRunMetadata": {
"type": "object",
"properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"title": "Labels Additional labels to add to the AnalysisRun\n+optional"
},
"annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"title": "Annotations additional annotations to add to the AnalysisRun\n+optional"
}
},
"title": "AnalysisRunMetadata extra labels to add to the AnalysisRun"
},
"github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AnalysisRunStrategy": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1225,6 +1245,10 @@
"$ref": "#/definitions/github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.MeasurementRetention"
},
"title": "MeasurementRetention object contains the settings for retaining the number of measurements during the analysis\n+patchMergeKey=metricName\n+patchStrategy=merge\n+optional"
},
"analysisRunMetadata": {
"$ref": "#/definitions/github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AnalysisRunMetadata",
"title": "AnalysisRunMetadata labels and annotations that will be added to the AnalysisRuns\n+optional"
}
},
"title": "RolloutAnalysis defines a template that is used to create a analysisRun"
Expand Down
Loading

0 comments on commit f72e565

Please sign in to comment.