Skip to content

Commit 734c781

Browse files
Merge pull request #76 from codefresh-io/advanced-sync
feat: advanced sync
2 parents 1b5790f + e81c6e4 commit 734c781

19 files changed

+1476
-595
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ ifneq ($(GIT_TAG),)
8585
override LDFLAGS += -X github.com/argoproj/argo-workflows/v3.gitTag=${GIT_TAG}
8686
endif
8787

88+
ifndef $(GOPATH)
89+
GOPATH=$(shell go env GOPATH)
90+
export GOPATH
91+
endif
92+
8893
ARGOEXEC_PKGS := $(shell echo cmd/argoexec && go list -f '{{ join .Deps "\n" }}' ./cmd/argoexec/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-)
8994
CLI_PKGS := $(shell echo cmd/argo && go list -f '{{ join .Deps "\n" }}' ./cmd/argo/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-)
9095
CONTROLLER_PKGS := $(shell echo cmd/workflow-controller && go list -f '{{ join .Deps "\n" }}' ./cmd/workflow-controller/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-)
@@ -130,11 +135,6 @@ define protoc
130135

131136
endef
132137

133-
ifndef $(GOPATH)
134-
GOPATH=$(shell go env GOPATH)
135-
export GOPATH
136-
endif
137-
138138
.PHONY: build
139139
build: clis images
140140

api/jsonschema/schema.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5592,6 +5592,13 @@
55925592
"name": {
55935593
"description": "name of the mutex",
55945594
"type": "string"
5595+
},
5596+
"selectors": {
5597+
"description": "Selectors is a list of references to dynamic values (like parameters, labels, annotations) that can be added to mutex key to make concurrency more customizable",
5598+
"items": {
5599+
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SyncSelector"
5600+
},
5601+
"type": "array"
55955602
}
55965603
},
55975604
"type": "object"
@@ -6374,6 +6381,13 @@
63746381
"configMapKeyRef": {
63756382
"$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapKeySelector",
63766383
"description": "ConfigMapKeyRef is configmap selector for Semaphore configuration"
6384+
},
6385+
"selectors": {
6386+
"description": "Selectors is a list of references to dynamic values (like parameters, labels, annotations) that can be added to semaphore key to make concurrency more customizable",
6387+
"items": {
6388+
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SyncSelector"
6389+
},
6390+
"type": "array"
63776391
}
63786392
},
63796393
"type": "object"
@@ -6506,6 +6520,20 @@
65066520
},
65076521
"type": "object"
65086522
},
6523+
"io.argoproj.workflow.v1alpha1.SyncSelector": {
6524+
"description": "Synchronization selector",
6525+
"properties": {
6526+
"name": {
6527+
"description": "Name of the selector",
6528+
"type": "string"
6529+
},
6530+
"template": {
6531+
"description": "Template replaced with global variables",
6532+
"type": "string"
6533+
}
6534+
},
6535+
"type": "object"
6536+
},
65096537
"io.argoproj.workflow.v1alpha1.Synchronization": {
65106538
"description": "Synchronization holds synchronization lock configuration",
65116539
"properties": {

api/openapi-spec/swagger.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9738,6 +9738,13 @@
97389738
"name": {
97399739
"description": "name of the mutex",
97409740
"type": "string"
9741+
},
9742+
"selectors": {
9743+
"description": "Selectors is a list of references to dynamic values (like parameters, labels, annotations) that can be added to mutex key to make concurrency more customizable",
9744+
"type": "array",
9745+
"items": {
9746+
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SyncSelector"
9747+
}
97419748
}
97429749
}
97439750
},
@@ -10520,6 +10527,13 @@
1052010527
"configMapKeyRef": {
1052110528
"description": "ConfigMapKeyRef is configmap selector for Semaphore configuration",
1052210529
"$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapKeySelector"
10530+
},
10531+
"selectors": {
10532+
"description": "Selectors is a list of references to dynamic values (like parameters, labels, annotations) that can be added to semaphore key to make concurrency more customizable",
10533+
"type": "array",
10534+
"items": {
10535+
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.SyncSelector"
10536+
}
1052310537
}
1052410538
}
1052510539
},
@@ -10651,6 +10665,20 @@
1065110665
}
1065210666
}
1065310667
},
10668+
"io.argoproj.workflow.v1alpha1.SyncSelector": {
10669+
"description": "Synchronization selector",
10670+
"type": "object",
10671+
"properties": {
10672+
"name": {
10673+
"description": "Name of the selector",
10674+
"type": "string"
10675+
},
10676+
"template": {
10677+
"description": "Template replaced with global variables",
10678+
"type": "string"
10679+
}
10680+
}
10681+
},
1065410682
"io.argoproj.workflow.v1alpha1.Synchronization": {
1065510683
"description": "Synchronization holds synchronization lock configuration",
1065610684
"type": "object",

docs/fields.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,7 @@ Mutex holds Mutex configuration
26262626
| Field Name | Field Type | Description |
26272627
|:----------:|:----------:|---------------|
26282628
|`name`|`string`|name of the mutex|
2629+
|`selectors`|`Array<`[`SyncSelector`](#syncselector)`>`|Selectors is a list of references to dynamic values (like parameters, labels, annotations) that can be added to mutex key to make concurrency more customizable|
26292630

26302631
## SemaphoreRef
26312632

@@ -2644,6 +2645,7 @@ SemaphoreRef is a reference of Semaphore
26442645
| Field Name | Field Type | Description |
26452646
|:----------:|:----------:|---------------|
26462647
|`configMapKeyRef`|[`ConfigMapKeySelector`](#configmapkeyselector)|ConfigMapKeyRef is configmap selector for Semaphore configuration|
2648+
|`selectors`|`Array<`[`SyncSelector`](#syncselector)`>`|Selectors is a list of references to dynamic values (like parameters, labels, annotations) that can be added to semaphore key to make concurrency more customizable|
26472649

26482650
## ArtifactLocation
26492651

@@ -3964,6 +3966,23 @@ MetricLabel is a single label for a prometheus metric
39643966

39653967
RetryNodeAntiAffinity is a placeholder for future expansion, only empty nodeAntiAffinity is allowed. In order to prevent running steps on the same host, it uses "kubernetes.io/hostname".
39663968

3969+
## SyncSelector
3970+
3971+
Synchronization selector
3972+
3973+
<details>
3974+
<summary>Examples with this field (click to open)</summary>
3975+
<br>
3976+
3977+
- [`input-artifact-git.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/input-artifact-git.yaml)
3978+
</details>
3979+
3980+
### Fields
3981+
| Field Name | Field Type | Description |
3982+
|:----------:|:----------:|---------------|
3983+
|`name`|`string`|Name of the selector|
3984+
|`template`|`string`|Template replaced with global variables|
3985+
39673986
## ContainerNode
39683987

39693988
_No description available_

manifests/base/crds/full/argoproj.io_clusterworkflowtemplates.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,15 @@ spec:
10881088
properties:
10891089
name:
10901090
type: string
1091+
selectors:
1092+
items:
1093+
properties:
1094+
name:
1095+
type: string
1096+
template:
1097+
type: string
1098+
type: object
1099+
type: array
10911100
type: object
10921101
semaphore:
10931102
properties:
@@ -1102,6 +1111,15 @@ spec:
11021111
required:
11031112
- key
11041113
type: object
1114+
selectors:
1115+
items:
1116+
properties:
1117+
name:
1118+
type: string
1119+
template:
1120+
type: string
1121+
type: object
1122+
type: array
11051123
type: object
11061124
type: object
11071125
templateDefaults:
@@ -6850,6 +6868,15 @@ spec:
68506868
properties:
68516869
name:
68526870
type: string
6871+
selectors:
6872+
items:
6873+
properties:
6874+
name:
6875+
type: string
6876+
template:
6877+
type: string
6878+
type: object
6879+
type: array
68536880
type: object
68546881
semaphore:
68556882
properties:
@@ -6864,6 +6891,15 @@ spec:
68646891
required:
68656892
- key
68666893
type: object
6894+
selectors:
6895+
items:
6896+
properties:
6897+
name:
6898+
type: string
6899+
template:
6900+
type: string
6901+
type: object
6902+
type: array
68676903
type: object
68686904
type: object
68696905
timeout:
@@ -13300,6 +13336,15 @@ spec:
1330013336
properties:
1330113337
name:
1330213338
type: string
13339+
selectors:
13340+
items:
13341+
properties:
13342+
name:
13343+
type: string
13344+
template:
13345+
type: string
13346+
type: object
13347+
type: array
1330313348
type: object
1330413349
semaphore:
1330513350
properties:
@@ -13314,6 +13359,15 @@ spec:
1331413359
required:
1331513360
- key
1331613361
type: object
13362+
selectors:
13363+
items:
13364+
properties:
13365+
name:
13366+
type: string
13367+
template:
13368+
type: string
13369+
type: object
13370+
type: array
1331713371
type: object
1331813372
type: object
1331913373
timeout:

manifests/base/crds/full/argoproj.io_cronworkflows.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,15 @@ spec:
11091109
properties:
11101110
name:
11111111
type: string
1112+
selectors:
1113+
items:
1114+
properties:
1115+
name:
1116+
type: string
1117+
template:
1118+
type: string
1119+
type: object
1120+
type: array
11121121
type: object
11131122
semaphore:
11141123
properties:
@@ -1123,6 +1132,15 @@ spec:
11231132
required:
11241133
- key
11251134
type: object
1135+
selectors:
1136+
items:
1137+
properties:
1138+
name:
1139+
type: string
1140+
template:
1141+
type: string
1142+
type: object
1143+
type: array
11261144
type: object
11271145
type: object
11281146
templateDefaults:
@@ -6871,6 +6889,15 @@ spec:
68716889
properties:
68726890
name:
68736891
type: string
6892+
selectors:
6893+
items:
6894+
properties:
6895+
name:
6896+
type: string
6897+
template:
6898+
type: string
6899+
type: object
6900+
type: array
68746901
type: object
68756902
semaphore:
68766903
properties:
@@ -6885,6 +6912,15 @@ spec:
68856912
required:
68866913
- key
68876914
type: object
6915+
selectors:
6916+
items:
6917+
properties:
6918+
name:
6919+
type: string
6920+
template:
6921+
type: string
6922+
type: object
6923+
type: array
68886924
type: object
68896925
type: object
68906926
timeout:
@@ -13321,6 +13357,15 @@ spec:
1332113357
properties:
1332213358
name:
1332313359
type: string
13360+
selectors:
13361+
items:
13362+
properties:
13363+
name:
13364+
type: string
13365+
template:
13366+
type: string
13367+
type: object
13368+
type: array
1332413369
type: object
1332513370
semaphore:
1332613371
properties:
@@ -13335,6 +13380,15 @@ spec:
1333513380
required:
1333613381
- key
1333713382
type: object
13383+
selectors:
13384+
items:
13385+
properties:
13386+
name:
13387+
type: string
13388+
template:
13389+
type: string
13390+
type: object
13391+
type: array
1333813392
type: object
1333913393
type: object
1334013394
timeout:

0 commit comments

Comments
 (0)