diff --git a/docs/fields.md b/docs/fields.md
index 38f82476a4d6..0cc4e7efeda4 100644
--- a/docs/fields.md
+++ b/docs/fields.md
@@ -323,8 +323,12 @@ Workflow is the definition of a workflow resource
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
@@ -751,8 +755,12 @@ WorkflowSpec is the specification of a Workflow.
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
@@ -1194,8 +1202,12 @@ CronWorkflowSpec is the specification of a CronWorkflow
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
@@ -1439,6 +1451,8 @@ Arguments to a template
- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template-outputs.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/work-avoidance.yaml)
@@ -1630,8 +1644,12 @@ Synchronization holds synchronization lock configuration
Examples with this field (click to open)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
@@ -1946,8 +1964,12 @@ SynchronizationStatus stores the status of semaphore and mutex.
Examples with this field (click to open)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
@@ -2241,6 +2263,8 @@ Parameter indicate a passed string parameter to a service template with an optio
- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template-outputs.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/work-avoidance.yaml)
@@ -2357,6 +2381,14 @@ Backoff is a backoff strategy to use within retryStrategy
Mutex holds Mutex configuration
+
+Examples with this field (click to open)
+
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
+
### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
@@ -3103,6 +3135,8 @@ WorkflowStep is a reference to a template to execute in a series of step
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
@@ -3233,6 +3267,14 @@ NodeSynchronizationStatus stores the status of a node
MutexStatus contains which objects hold mutex locks, and which objects this workflow is waiting on to release locks.
+
+Examples with this field (click to open)
+
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
+
### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
@@ -4857,8 +4899,12 @@ ObjectMeta is metadata that all persisted resources must have, which includes al
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
@@ -5442,8 +5488,12 @@ A single application container that you want to run within a pod.
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
@@ -6177,8 +6227,12 @@ PersistentVolumeClaimSpec describes the common attributes of storage devices and
- [`suspend-template.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/suspend-template.yaml)
+- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
+
- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+
- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
- [`template-defaults.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml)
diff --git a/docs/synchronization.md b/docs/synchronization.md
index 94f8891e4d4e..8c5ef695ce90 100644
--- a/docs/synchronization.md
+++ b/docs/synchronization.md
@@ -1,7 +1,6 @@
# Synchronization
> v2.10 and after
-> v3.6 for multiple
You can limit the parallel execution of workflows or templates:
@@ -152,6 +151,10 @@ Examples:
1. [Workflow level mutex](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
1. [Step level semaphore](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-tmpl-level.yaml)
1. [Step level mutex](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
+1. [Legacy workflow level semaphore](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-wf-level-legacy.yaml)
+1. [Legacy workflow level mutex](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)
+1. [Legacy step level semaphore](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-tmpl-level-legacy.yaml)
+1. [Legacy step level mutex](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)
## Queuing
@@ -165,6 +168,8 @@ Workflows can only acquire a lock if they are at the front of the queue for that
## Multiple locks
+> v3.6 and after
+
You can specify multiple locks in a single workflow or template.
```yaml
diff --git a/examples/synchronization-mutex-tmpl-level-legacy.yaml b/examples/synchronization-mutex-tmpl-level-legacy.yaml
new file mode 100644
index 000000000000..9652e48a7d0a
--- /dev/null
+++ b/examples/synchronization-mutex-tmpl-level-legacy.yaml
@@ -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"]
\ No newline at end of file
diff --git a/examples/synchronization-mutex-wf-level-legacy.yaml b/examples/synchronization-mutex-wf-level-legacy.yaml
new file mode 100644
index 000000000000..f13b199c6aaa
--- /dev/null
+++ b/examples/synchronization-mutex-wf-level-legacy.yaml
@@ -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"]
diff --git a/examples/synchronization-tmpl-level-legacy.yaml b/examples/synchronization-tmpl-level-legacy.yaml
new file mode 100644
index 000000000000..b8c0f79c6c6f
--- /dev/null
+++ b/examples/synchronization-tmpl-level-legacy.yaml
@@ -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"]
diff --git a/examples/synchronization-wf-level-legacy.yaml b/examples/synchronization-wf-level-legacy.yaml
new file mode 100644
index 000000000000..b7ed90a092ca
--- /dev/null
+++ b/examples/synchronization-wf-level-legacy.yaml
@@ -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"]