-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refresh examples and cleanup make targets (#1216)
**Pull Request Checklist** - [x] Fixes `make test` - [x] Tests added - [x] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** New examples were added for Argo Workflows 3.6, but we don't yet support the fields (until 3.6 official release, then #1215 will address this) - for now rename the `synchronization` examples (add `legacy` suffix). This PR also tidies up the `make` targets to avoid running unrelated code (`regenerate-test-data`) and separate out lint checks from the main `test` target for faster iteration speed (added `test-lint` to `ci`). --------- Signed-off-by: Elliot Gunton <[email protected]>
- Loading branch information
1 parent
d75a1b3
commit 8166d8b
Showing
24 changed files
with
208 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tream/synchronization_mutex_tmpl_level.md → ...ynchronization_mutex_tmpl_level_legacy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ws/upstream/synchronization_tmpl_level.md → ...ream/synchronization_tmpl_level_legacy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...lows/upstream/synchronization_wf_level.md → ...stream/synchronization_wf_level_legacy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
22 changes: 22 additions & 0 deletions
22
examples/workflows/upstream/cron-workflow-multiple-schedules.upstream.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: CronWorkflow | ||
metadata: | ||
name: hello-world-multiple-schedules | ||
spec: | ||
schedules: # v3.6 and after | ||
- "*/3 * * * *" | ||
- "*/2 * * * *" | ||
timezone: "America/Los_Angeles" # Default to local machine timezone | ||
startingDeadlineSeconds: 0 | ||
concurrencyPolicy: "Replace" # Default to "Allow" | ||
successfulJobsHistoryLimit: 4 # Default 3 | ||
failedJobsHistoryLimit: 4 # Default 1 | ||
suspend: false # Set to "true" to suspend scheduling | ||
workflowSpec: | ||
entrypoint: whalesay | ||
templates: | ||
- name: whalesay | ||
container: | ||
image: docker/whalesay:latest | ||
command: [cowsay] | ||
args: ["🕓 hello world. Scheduled on: {{workflow.scheduledTime}}"] |
45 changes: 45 additions & 0 deletions
45
examples/workflows/upstream/synchronization-mutex-tmpl-level-legacy.upstream.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This example demonstrates the use of a Synchronization Mutex lock on template execution. Mutex lock limits | ||
# only one of the template execution across the workflows in the namespace which has same Mutex lock. | ||
|
||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: synchronization-tmpl-level-mutex- | ||
spec: | ||
entrypoint: synchronization-tmpl-level-mutex-example | ||
templates: | ||
- name: synchronization-tmpl-level-mutex-example | ||
steps: | ||
- - name: synchronization-acquire-lock | ||
template: acquire-lock | ||
arguments: | ||
parameters: | ||
- name: seconds | ||
value: "{{item}}" | ||
withParam: '["1","2","3","4","5"]' | ||
|
||
- name: synchronization-acquire-lock1 | ||
template: acquire-lock-1 | ||
arguments: | ||
parameters: | ||
- name: seconds | ||
value: "{{item}}" | ||
withParam: '["1","2","3","4","5"]' | ||
|
||
- name: acquire-lock | ||
synchronization: | ||
mutex: | ||
name: welcome | ||
container: | ||
image: alpine:latest | ||
command: [sh, -c] | ||
args: ["sleep 20; echo acquired lock"] | ||
|
||
- name: acquire-lock-1 | ||
synchronization: | ||
mutex: | ||
name: test | ||
container: | ||
image: alpine:latest | ||
command: [sh, -c] | ||
args: ["sleep 50; echo acquired lock"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
examples/workflows/upstream/synchronization-mutex-wf-level-legacy.upstream.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This example demonstrates the use of a Synchronization Mutex lock on workflow execution. Mutex lock limits | ||
# only one of the workflow execution in the namespace which has same Mutex lock. | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: synchronization-wf-level- | ||
spec: | ||
entrypoint: hello-world | ||
synchronization: | ||
mutex: | ||
name: test | ||
templates: | ||
- name: hello-world | ||
container: | ||
image: busybox | ||
command: [echo] | ||
args: ["hello world"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
examples/workflows/upstream/synchronization-tmpl-level-legacy.upstream.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This example demonstrates the use of a Synchronization lock on template execution. Synchronization lock limits | ||
# the number of concurrent template execution across the workflows in the namespace which has same Synchronization lock. | ||
# Synchronization limit value can be configured in configmap. Eg.: | ||
# apiVersion: v1 | ||
# kind: ConfigMap | ||
# metadata: | ||
# name: my-config | ||
# data: | ||
# template: "3" | ||
#--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: synchronization-tmpl-level- | ||
spec: | ||
entrypoint: synchronization-tmpl-level-example | ||
templates: | ||
- name: synchronization-tmpl-level-example | ||
steps: | ||
- - name: synchronization-acquire-lock | ||
template: acquire-lock | ||
arguments: | ||
parameters: | ||
- name: seconds | ||
value: "{{item}}" | ||
withParam: '["1","2","3","4","5"]' | ||
|
||
- name: acquire-lock | ||
synchronization: | ||
semaphore: | ||
configMapKeyRef: | ||
name: my-config | ||
key: template | ||
container: | ||
image: alpine:latest | ||
command: [sh, -c] | ||
args: ["sleep 10; echo acquired lock"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
examples/workflows/upstream/synchronization-wf-level-legacy.upstream.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This example demonstrates the use of a Synchronization lock on workflow execution. Synchronization lock limits | ||
# the number of concurrent workflow execution in the namespace which has same Synchronization lock. Synchronization | ||
# limit value can be configured in configmap. | ||
# Eg.: | ||
# apiVersion: v1 | ||
# kind: ConfigMap | ||
# metadata: | ||
# name: my-config | ||
# data: | ||
# workflow: "3" | ||
#--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: synchronization-wf-level- | ||
spec: | ||
entrypoint: hello-world | ||
synchronization: | ||
semaphore: | ||
configMapKeyRef: | ||
name: my-config | ||
key: workflow | ||
templates: | ||
- name: hello-world | ||
container: | ||
image: busybox | ||
command: [echo] | ||
args: ["hello world"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters