Skip to content

Commit

Permalink
Merge branch 'main' into ci_1.31
Browse files Browse the repository at this point in the history
  • Loading branch information
blkperl authored Sep 17, 2024
2 parents f7f580f + 818fd90 commit a5fe9b5
Show file tree
Hide file tree
Showing 30 changed files with 1,068 additions and 728 deletions.
4 changes: 4 additions & 0 deletions api/jsonschema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ CronWorkflow is the definition of a scheduled workflow resource

- [`cron-backfill.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-backfill.yaml)

- [`cron-when.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-when.yaml)

- [`cron-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-workflow.yaml)

- [`dag-inline-cronworkflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/dag-inline-cronworkflow.yaml)
Expand Down Expand Up @@ -505,6 +507,8 @@ WorkflowSpec is the specification of a Workflow.

- [`cron-backfill.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-backfill.yaml)

- [`cron-when.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-when.yaml)

- [`cron-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-workflow.yaml)

- [`custom-metrics.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/custom-metrics.yaml)
Expand Down Expand Up @@ -948,6 +952,8 @@ CronWorkflowSpec is the specification of a CronWorkflow

- [`cron-backfill.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-backfill.yaml)

- [`cron-when.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-when.yaml)

- [`cron-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-workflow.yaml)

- [`custom-metrics.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/custom-metrics.yaml)
Expand Down Expand Up @@ -1253,6 +1259,7 @@ CronWorkflowSpec is the specification of a CronWorkflow
|`successfulJobsHistoryLimit`|`integer`|SuccessfulJobsHistoryLimit is the number of successful jobs to be kept at a time|
|`suspend`|`boolean`|Suspend is a flag that will stop new CronWorkflows from running if set to true|
|`timezone`|`string`|Timezone is the timezone against which the cron schedule will be calculated, e.g. "Asia/Tokyo". Default is machine's local time.|
|`when`|`string`|v3.6 and after: When is an expression that determines if a run should be scheduled.|
|`workflowMetadata`|[`ObjectMeta`](#objectmeta)|WorkflowMetadata contains some metadata of the workflow to be run|
|`workflowSpec`|[`WorkflowSpec`](#workflowspec)|WorkflowSpec is the spec of the workflow to be run|

Expand Down Expand Up @@ -4625,6 +4632,8 @@ ObjectMeta is metadata that all persisted resources must have, which includes al

- [`cron-backfill.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-backfill.yaml)

- [`cron-when.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-when.yaml)

- [`cron-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-workflow.yaml)

- [`custom-metrics.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/custom-metrics.yaml)
Expand Down Expand Up @@ -5244,6 +5253,8 @@ A single application container that you want to run within a pod.

- [`continue-on-fail.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/continue-on-fail.yaml)

- [`cron-when.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-when.yaml)

- [`cron-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-workflow.yaml)

- [`custom-metrics.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/custom-metrics.yaml)
Expand Down Expand Up @@ -5945,6 +5956,8 @@ PersistentVolumeClaimSpec describes the common attributes of storage devices and

- [`cron-backfill.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-backfill.yaml)

- [`cron-when.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-when.yaml)

- [`cron-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/cron-workflow.yaml)

- [`custom-metrics.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/custom-metrics.yaml)
Expand Down
21 changes: 16 additions & 5 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,25 @@ Metrics for the [Four Golden Signals](https://sre.google/sre-book/monitoring-dis
Some metric attributes may have high cardinality and are marked with ⚠️ to warn you. You may need to disable this metric or disable the attribute.
<!-- titles should be the exact metric name for deep-linking, alphabetical ordered -->
<!-- titles are without argo_workflows prefix -->
#### `cronworkflows_concurrencypolicy_triggered`

A counter of the number of times a CronWorkflow has triggered its `concurrencyPolicy` to limit the number of workflows running.

| attribute | explanation |
|-------------|-------------------------------------------|
| `name` | ⚠️ The name of the CronWorkflow |
| `namespace` | The namespace of the CronWorkflow |
| `concurrency_policy` | The concurrency policy which was triggered, will be either `Forbid` or `Replace` |

#### `cronworkflows_triggered_total`

A counter of the number of times a CronWorkflow has been
A counter of the number of times a CronWorkflow has been triggered.
Suppressed runs due to `concurrencyPolicy: Forbid` will not be counted.

| attribute | explanation |
|-------------|-------------------------------------------|
| `name` | ⚠️ The name of the CronWorkflow. |
| `namespace` | The namespace in which the pod is running |
| `name` | ⚠️ The name of the CronWorkflow |
| `namespace` | The namespace of the CronWorkflow |

#### `gauge`

Expand All @@ -229,8 +240,8 @@ A counter of certain errors incurred by the controller.
The currently tracked specific errors are

- `OperationPanic` - the controller `panic()` on a programming bug
- `CronWorkflowSubmissionError` - A cron workflow failed submission
- `CronWorkflowSpecError` - A cron workflow has an invalid specification
- `CronWorkflowSubmissionError` - A CronWorkflow failed submission
- `CronWorkflowSpecError` - A CronWorkflow has an invalid specification

#### `k8s_request_total`

Expand Down
1 change: 1 addition & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ These notes explain the differences in using the Prometheus `/metrics` endpoint

The following are new metrics:

* `cronworkflows_concurrencypolicy_triggered`
* `cronworkflows_triggered_total`
* `is_leader`
* `k8s_request_duration`
Expand Down
14 changes: 14 additions & 0 deletions docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ Only available for `successCondition`
| `response.body` | Response body (`string`) |
| `response.headers` | Response headers (`map[string][]string`) |

### CronWorkflows

> v3.6 and after

| Variable | Description|
|----------|------------|
| `cronworkflow.name` | Name of the CronWorkflow (`string`) |
| `cronworkflow.namespace` | Namespace of the CronWorkflow (`string`) |
| `cronworkflow.labels.<NAME>` | CronWorkflow labels (`string`) |
| `cronworkflow.labels.json` | CronWorkflow labels as a JSON string (`string`) |
| `cronworkflow.annotations.<NAME>` | CronWorkflow annotations (`string`) |
| `cronworkflow.annotations.json` | CronWorkflow annotations as a JSON string (`string`) |
| `cronworkflow.lastScheduledTime` | The time since this workflow was last scheduled, value is nil on first run (`*time.Time`) |

### `RetryStrategy`

When using the `expression` field within `retryStrategy`, special variables are available.
Expand Down
16 changes: 16 additions & 0 deletions examples/cron-when.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: sleep-when
spec:
schedule: "* * * * *"
concurrencyPolicy: "Allow"
when: "{{= cronworkflow.lastScheduledTime == nil || (now() - cronworkflow.lastScheduledTime).Seconds() > 360 }}"
workflowSpec:
entrypoint: sleep-busybox
templates:
- name: sleep-busybox
container:
image: busybox
command: [sleep]
args: ["10"]
2 changes: 2 additions & 0 deletions manifests/base/crds/full/argoproj.io_cronworkflows.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/apis/workflow/v1alpha1/cron_workflow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ type CronWorkflowSpec struct {
StopStrategy *StopStrategy `json:"stopStrategy,omitempty" protobuf:"bytes,10,opt,name=stopStrategy"`
// Schedules is a list of schedules to run the Workflow in Cron format
Schedules []string `json:"schedules,omitempty" protobuf:"bytes,11,opt,name=schedules"`
// v3.6 and after: When is an expression that determines if a run should be scheduled.
When string `json:"when,omitempty" protobuf:"bytes,12,opt,name=when"`
}

// v3.6 and after: StopStrategy defines if the CronWorkflow should stop scheduling based on a condition
Expand Down
Loading

0 comments on commit a5fe9b5

Please sign in to comment.