-
New Feature
-
Resolution: Fixed
-
Major
Add support to use this plugin from workflow to manage concurrent consumption of resources.
Similar to how stage step works as blocked scoped to control concurrency of other builds for this job running this step at the same time, it would be useful to be able to do this for resources across jobs.
Continue to allow the resources to be set up in the Jenkins configuration.
Consumption of resources should be controlled with a syntax along these lines:
For a single resource:
resource (name: db-a-1, reservedVariable: DB_RESOURCE) {
// Do something here that uses the resource
echo “DB Resource(s) used = $DB_RESOURCE”
}
For a pool of resources sharing a label:
resource (label: db-a, quantity: 2, reservedVariable: DB_RESOURCE) {
// Do something here that uses the resource
echo “DB Resource(s) used = $DB_RESOURCE”
}
- is duplicated by
-
JENKINS-30757 Use stage as a resource lock
-
- Resolved
-
- is related to
-
JENKINS-34268 Lock multiple resources using the Pipeline lock step
-
- Resolved
-
-
JENKINS-34273 Extend quantity configuration to Pipeline lock step
-
- Resolved
-
-
JENKINS-29892 Block of stages functioning as a concurrency unit
-
- Resolved
-
-
JENKINS-29207 Enhancement: make recources addressable in build-flow plugin
-
- Closed
-
- links to
[JENKINS-30269] Add workflow support for resource locking
Description |
Original:
Add support to use this plugin from workflow to manage concurrent consumption of resources. Similar to how {{stage}} step works as blocked scoped to control concurrency of other builds for this job running this step at the same time, it would be useful to be able to do this for resources across jobs. Continue to allow the resources to be set up in the Jenkins configuration. Consumption of resources should be controlled with a syntax along these lines: For a single resource: resource (name: db-a-1, reservedVariable: DB_RESOURCE) { // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } For a pool of resources sharing a label: resource (label: db-a, quantity: 2, reservedVariable: DB_RESOURCE) { // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } |
New:
Add support to use this plugin from workflow to manage concurrent consumption of resources. Similar to how {{stage}} step works as blocked scoped to control concurrency of other builds for this job running this step at the same time, it would be useful to be able to do this for resources across jobs. Continue to allow the resources to be set up in the Jenkins configuration. Consumption of resources should be controlled with a syntax along these lines: For a single resource: resource (name: db-a-1, reservedVariable: DB_RESOURCE) { // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } For a pool of resources sharing a label: resource (label: db-a, quantity: 2, reservedVariable: DB_RESOURCE) { // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } |
Description |
Original:
Add support to use this plugin from workflow to manage concurrent consumption of resources. Similar to how {{stage}} step works as blocked scoped to control concurrency of other builds for this job running this step at the same time, it would be useful to be able to do this for resources across jobs. Continue to allow the resources to be set up in the Jenkins configuration. Consumption of resources should be controlled with a syntax along these lines: For a single resource: resource (name: db-a-1, reservedVariable: DB_RESOURCE) { // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } For a pool of resources sharing a label: resource (label: db-a, quantity: 2, reservedVariable: DB_RESOURCE) { // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } |
New:
Add support to use this plugin from workflow to manage concurrent consumption of resources. Similar to how {{stage}} step works as blocked scoped to control concurrency of other builds for this job running this step at the same time, it would be useful to be able to do this for resources across jobs. Continue to allow the resources to be set up in the Jenkins configuration. Consumption of resources should be controlled with a syntax along these lines: For a single resource: resource (name: db-a-1, reservedVariable: DB_RESOURCE) \{ // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } For a pool of resources sharing a label: resource (label: db-a, quantity: 2, reservedVariable: DB_RESOURCE) \{ // Do something here that uses the resource echo “DB Resource(s) used = $DB_RESOURCE” } |
Issue Type | Original: Improvement [ 4 ] | New: New Feature [ 2 ] |
Link |
New:
This issue is duplicated by |
This would be highly appreciated for controlling nodes that can run one (1) instance of a software that's needed in a build at a time. A different approach would be 'labelled executors', or alternatively 'virtual slaves'. Personally I would prefer such a solution to resource locking (of course, counting software licences is a different use case).