Skip to content

Commit

Permalink
feat: configurable and more aggressive cleanup of old AnalysisRuns an…
Browse files Browse the repository at this point in the history
…d Experiments (#1342)

Signed-off-by: Andrii Perenesenko <andrii.perenesenko@gmail.com>
  • Loading branch information
perenesenko authored Aug 5, 2021
1 parent 2620490 commit ffe70da
Show file tree
Hide file tree
Showing 19 changed files with 1,029 additions and 437 deletions.
8 changes: 8 additions & 0 deletions docs/features/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ spec:
# Number of desired pods.
# Defaults to 1.
replicas: 5
analysis:
# limits the number of successful analysis runs and experiments to be stored in a history
# Defaults to 5.
successfulRunHistoryLimit: 10
# limits the number of unsuccessful analysis runs and experiments to be stored in a history.
# Stages for unsuccessful: "Error", "Failed", "Inconclusive"
# Defaults to 5.
unsuccessfulRunHistoryLimit: 10

# Label selector for pods. Existing ReplicaSets whose pods are selected by
# this will be the ones affected by this rollout. It must match the pod
Expand Down
3 changes: 2 additions & 1 deletion examples/analysis-templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
args: [exit 0]
restartPolicy: Never
backoffLimit: 0

count: 1
---
# This AnalysisTemplate will run a Kubernetes Job every 5 seconds, with a 50% chance of failure.
# When the number of accumulated failures exceeds failureLimit, it will cause the analysis run to
Expand All @@ -36,6 +36,7 @@ metadata:
spec:
metrics:
- name: random-fail
count: 2
interval: 5s
failureLimit: 1
provider:
Expand Down
9 changes: 9 additions & 0 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ spec:
type: object
spec:
properties:
analysis:
properties:
successfulRunHistoryLimit:
format: int32
type: integer
unsuccessfulRunHistoryLimit:
format: int32
type: integer
type: object
minReadySeconds:
format: int32
type: integer
Expand Down
9 changes: 9 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9745,6 +9745,15 @@ spec:
type: object
spec:
properties:
analysis:
properties:
successfulRunHistoryLimit:
format: int32
type: integer
unsuccessfulRunHistoryLimit:
format: int32
type: integer
type: object
minReadySeconds:
format: int32
type: integer
Expand Down
9 changes: 9 additions & 0 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9745,6 +9745,15 @@ spec:
type: object
spec:
properties:
analysis:
properties:
successfulRunHistoryLimit:
format: int32
type: integer
unsuccessfulRunHistoryLimit:
format: int32
type: integer
type: object
minReadySeconds:
format: int32
type: integer
Expand Down
20 changes: 20 additions & 0 deletions pkg/apiclient/rollout/rollout.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,22 @@
},
"title": "AnalysisRunArgument argument to add to analysisRun"
},
"github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AnalysisRunStrategy": {
"type": "object",
"properties": {
"successfulRunHistoryLimit": {
"type": "integer",
"format": "int32",
"title": "SuccessfulRunHistoryLimit limits the number of old successful analysis runs and experiments to be retained in a history"
},
"unsuccessfulRunHistoryLimit": {
"type": "integer",
"format": "int32",
"title": "UnsuccessfulRunHistoryLimit limits the number of old unsuccessful analysis runs and experiments to be retained in a history.\nStages for unsuccessful: \"Error\", \"Failed\", \"Inconclusive\""
}
},
"title": "AnalysisRunStrategy configuration for the analysis runs and experiments to retain"
},
"github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AntiAffinity": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1165,6 +1181,10 @@
"restartAt": {
"$ref": "#/definitions/k8s.io.apimachinery.pkg.apis.meta.v1.Time",
"title": "RestartAt indicates when all the pods of a Rollout should be restarted"
},
"analysis": {
"$ref": "#/definitions/github.com.argoproj.argo_rollouts.pkg.apis.rollouts.v1alpha1.AnalysisRunStrategy",
"title": "Analysis configuration for the analysis runs to retain"
}
},
"title": "RolloutSpec is the spec for a Rollout resource"
Expand Down
Loading

0 comments on commit ffe70da

Please sign in to comment.