-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): more updates and examples
Signed-off-by: Alan Clucas <[email protected]>
- Loading branch information
Showing
6 changed files
with
187 additions
and
1 deletion.
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
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"] |
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
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"] |
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"] |