Skip to content

Commit

Permalink
feat(controller): Mutexes. Closes argoproj#2677 (argoproj#3631)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabala1979 authored Aug 23, 2020
1 parent a821c6d commit a24bc94
Show file tree
Hide file tree
Showing 23 changed files with 2,550 additions and 1,076 deletions.
72 changes: 57 additions & 15 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2612,19 +2612,6 @@
}
}
},
"io.argoproj.workflow.v1alpha1.HolderNames": {
"type": "object",
"properties": {
"name": {
"description": "Name stores the name of the resource holding lock",
"type": "array",
"items": {
"type": "string"
},
"x-kubernetes-list-type": "atomic"
}
}
},
"io.argoproj.workflow.v1alpha1.InfoResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2798,6 +2785,52 @@
}
}
},
"io.argoproj.workflow.v1alpha1.Mutex": {
"description": "Mutex holds Mutex configuration",
"type": "object",
"properties": {
"name": {
"description": "name of the mutex",
"type": "string"
}
}
},
"io.argoproj.workflow.v1alpha1.MutexHolding": {
"description": "MutexHolding describes the mutex and the object which is holding it.",
"type": "object",
"properties": {
"holder": {
"description": "Holder is a reference to the object which holds the Mutex. Holding Scenario:\n 1. Current workflow's NodeID which is holding the lock.\n e.g: ${NodeID}\nWaiting Scenario:\n 1. Current workflow or other workflow NodeID which is holding the lock.\n e.g: ${WorkflowName}/${NodeID}",
"type": "string"
},
"mutex": {
"description": "Reference for the mutex e.g: ${namespace}/mutex/${mutexName}",
"type": "string"
}
}
},
"io.argoproj.workflow.v1alpha1.MutexStatus": {
"description": "MutexStatus contains which objects hold mutex locks, and which objects this workflow is waiting on to release locks.",
"type": "object",
"properties": {
"holding": {
"description": "Holding is a list of mutexes and their respective objects that are held by mutex lock for this io.argoproj.workflow.v1alpha1.",
"type": "array",
"items": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.MutexHolding"
},
"x-kubernetes-list-type": "atomic"
},
"waiting": {
"description": "Waiting is a list of mutexes and their respective objects this workflow is waiting for.",
"type": "array",
"items": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.MutexHolding"
},
"x-kubernetes-list-type": "atomic"
}
}
},
"io.argoproj.workflow.v1alpha1.NodeStatus": {
"description": "NodeStatus contains status information about an individual node in the workflow",
"type": "object",
Expand Down Expand Up @@ -3360,7 +3393,7 @@
}
},
"waiting": {
"description": "Waiting indicates the list of current synchronization lock holders",
"description": "Waiting indicates the list of current synchronization lock holders.",
"type": "array",
"items": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SemaphoreHolding"
Expand Down Expand Up @@ -3473,17 +3506,26 @@
"description": "Synchronization holds synchronization lock configuration",
"type": "object",
"properties": {
"mutex": {
"description": "Mutex holds the Mutex lock details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.Mutex"
},
"semaphore": {
"description": "Semaphore holds the Semaphore configuration",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SemaphoreRef"
}
}
},
"io.argoproj.workflow.v1alpha1.SynchronizationStatus": {
"description": "SynchronizationStatus stores the status of semaphore and mutex.",
"type": "object",
"properties": {
"mutex": {
"description": "Mutex stores this workflow's mutex holder details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.MutexStatus"
},
"semaphore": {
"description": "SemaphoreHolders stores this workflow's Semaphore holder details",
"description": "Semaphore stores this workflow's Semaphore holder details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SemaphoreStatus"
}
}
Expand Down
109 changes: 106 additions & 3 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ Workflow is the definition of a workflow resource

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -549,6 +553,10 @@ WorkflowSpec is the specification of a Workflow.

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -881,6 +889,10 @@ CronWorkflowSpec is the specification of a CronWorkflow

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -1176,6 +1188,10 @@ WorkflowTemplateSpec is a spec of WorkflowTemplate.

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -1381,6 +1397,8 @@ Arguments to a template

- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template-outputs.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`work-avoidance.yaml`](https://github.com/argoproj/argo/blob/master/examples/work-avoidance.yaml)
Expand Down Expand Up @@ -1470,6 +1488,10 @@ Synchronization holds synchronization lock configuration
<summary>Examples with this field (click to open)</summary>
<br>

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand All @@ -1478,6 +1500,7 @@ Synchronization holds synchronization lock configuration
### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`mutex`|[`Mutex`](#mutex)|Mutex holds the Mutex lock details|
|`semaphore`|[`SemaphoreRef`](#semaphoreref)|Semaphore holds the Semaphore configuration|

## Template
Expand Down Expand Up @@ -1710,6 +1733,10 @@ Template is a reusable and composable unit of execution in a workflow

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -1938,12 +1965,16 @@ Outputs hold parameters, artifacts, and results from a step

## SynchronizationStatus

_No description available_
SynchronizationStatus stores the status of semaphore and mutex.

<details>
<summary>Examples with this field (click to open)</summary>
<br>

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand All @@ -1952,7 +1983,8 @@ _No description available_
### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`semaphore`|[`SemaphoreStatus`](#semaphorestatus)|SemaphoreHolders stores this workflow's Semaphore holder details|
|`mutex`|[`MutexStatus`](#mutexstatus)|Mutex stores this workflow's mutex holder details|
|`semaphore`|[`SemaphoreStatus`](#semaphorestatus)|Semaphore stores this workflow's Semaphore holder details|

## Artifact

Expand Down Expand Up @@ -2151,6 +2183,8 @@ Parameter indicate a passed string parameter to a service template with an optio

- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template-outputs.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`work-avoidance.yaml`](https://github.com/argoproj/argo/blob/master/examples/work-avoidance.yaml)
Expand Down Expand Up @@ -2199,6 +2233,24 @@ Prometheus is a prometheus metric to be emitted
|`name`|`string`|Name is the name of the metric|
|`when`|`string`|When is a conditional statement that decides when to emit the metric|

## Mutex

Mutex holds Mutex configuration

<details>
<summary>Examples with this field (click to open)</summary>
<br>

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)
</details>

### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`name`|`string`|name of the mutex|

## SemaphoreRef

SemaphoreRef is a reference of Semaphore
Expand Down Expand Up @@ -2725,6 +2777,10 @@ Pod metdata

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -3030,6 +3086,8 @@ WorkflowStep is a reference to a template to execute in a series of step

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`template-on-exit.yaml`](https://github.com/argoproj/argo/blob/master/examples/template-on-exit.yaml)
Expand Down Expand Up @@ -3133,6 +3191,25 @@ _No description available_
|`hit`|`boolean`|_No description available_|
|`key`|`string`|_No description available_|

## MutexStatus

MutexStatus contains which objects hold mutex locks, and which objects this workflow is waiting on to release locks.

<details>
<summary>Examples with this field (click to open)</summary>
<br>

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)
</details>

### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`holding`|`Array<`[`MutexHolding`](#mutexholding)`>`|Holding is a list of mutexes and their respective objects that are held by mutex lock for this io.argoproj.workflow.v1alpha1.|
|`waiting`|`Array<`[`MutexHolding`](#mutexholding)`>`|Waiting is a list of mutexes and their respective objects this workflow is waiting for.|

## SemaphoreStatus

_No description available_
Expand All @@ -3150,7 +3227,7 @@ _No description available_
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`holding`|`Array<`[`SemaphoreHolding`](#semaphoreholding)`>`|Holding stores the list of resource acquired synchronization lock for workflows.|
|`waiting`|`Array<`[`SemaphoreHolding`](#semaphoreholding)`>`|Waiting indicates the list of current synchronization lock holders|
|`waiting`|`Array<`[`SemaphoreHolding`](#semaphoreholding)`>`|Waiting indicates the list of current synchronization lock holders.|

## ArchiveStrategy

Expand Down Expand Up @@ -3659,6 +3736,16 @@ Sequence expands a workflow step into numeric range
|`format`|`string`|Format is a printf format string to format the value in the sequence|
|`start`|[`IntOrString`](#intorstring)|Number at which to start the sequence (default: 0)|

## MutexHolding

MutexHolding describes the mutex and the object which is holding it.

### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`holder`|`string`|Holder is a reference to the object which holds the Mutex. Holding Scenario: 1. Current workflow's NodeID which is holding the lock. e.g: ${NodeID}Waiting Scenario: 1. Current workflow or other workflow NodeID which is holding the lock. e.g: ${WorkflowName}/${NodeID}|
|`mutex`|`string`|Reference for the mutex e.g: ${namespace}/mutex/${mutexName}|

## SemaphoreHolding

_No description available_
Expand Down Expand Up @@ -3957,6 +4044,10 @@ ObjectMeta is metadata that all persisted resources must have, which includes al

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -4445,6 +4536,10 @@ A single application container that you want to run within a pod.

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -5091,6 +5186,10 @@ PersistentVolumeClaimSpec describes the common attributes of storage devices and

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down Expand Up @@ -6092,6 +6191,10 @@ ListMeta describes metadata that synthetic resources must have, including lists

- [`suspend-template.yaml`](https://github.com/argoproj/argo/blob/master/examples/suspend-template.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-mutex-wf-level.yaml)

- [`synchronization-tmpl-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-tmpl-level.yaml)

- [`synchronization-wf-level.yaml`](https://github.com/argoproj/argo/blob/master/examples/synchronization-wf-level.yaml)
Expand Down
Loading

0 comments on commit a24bc94

Please sign in to comment.