Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34273

Extend quantity configuration to Pipeline lock step

    Details

    • Similar Issues:

      Description

      Extend the use of quantity configuration parameter to the lock step.

      The behavior should be the same than defined for freestyle builds.

      The DSL should look like this:

      lock (resource: 'RAM', quantity: 3) { ... }
      

      quantity must be applicable to any of resource, resources or label (see JENKINS-34268).

        Attachments

          Issue Links

            Activity

            Hide
            ssbarnea Sorin Sbarnea added a comment - - edited

            Thanks for fixing this. I observed that currently there is no way to configure the quantity of specific resource and we are forced to add lots of duplicated resources in order to overcome this. Still this does not scale and after 5-10 clones it becomes too hard to add additional. Due to this I raised JENKINS-42339 for adding a quantity inside the configure screen.

            Show
            ssbarnea Sorin Sbarnea added a comment - - edited Thanks for fixing this. I observed that currently there is no way to configure the quantity of specific resource and we are forced to add lots of duplicated resources in order to overcome this. Still this does not scale and after 5-10 clones it becomes too hard to add additional. Due to this I raised JENKINS-42339 for adding a quantity inside the configure screen.
            Hide
            mcorbion m corbion added a comment - - edited

            We are also looking for something like Sorin Sbarnea. We have a system running automation where we need to reserve resources dynamically some of them being clients and other being servers. Having the lock in a single step is highly important for us, however we don't always have the same number of servers as we have clients. We tried a workaround by creating a list of label or a chain of string  ['CLIENT', 'CLIENT', 'CLIENT', 'SERVER'] hoping that this can help us circumvent the problem but that's not how the plugin seems to work.

            Show
            mcorbion m corbion added a comment - - edited We are also looking for something like Sorin Sbarnea . We have a system running automation where we need to reserve resources dynamically some of them being clients and other being servers. Having the lock in a single step is highly important for us, however we don't always have the same number of servers as we have clients. We tried a workaround by creating a list of label or a chain of string  ['CLIENT', 'CLIENT', 'CLIENT', 'SERVER'] hoping that this can help us circumvent the problem but that's not how the plugin seems to work.
            Hide
            tstibbs t stibbs added a comment -

            Am I the only person who's ended up looking at this ticket to try and work out what the 'quantity' flag actually does? If I have a lockable resource called 'abc' and I say lock (resource: 'abc', quantity: 3), what does that actually do? I expected to somewhere set the maximum number of things available to lock within 'abc' and then the pipeline scripts could acquire 3 of them, but I don't see how to set the max. So it acquires 3, out of...?

            Show
            tstibbs t stibbs added a comment - Am I the only person who's ended up looking at this ticket to try and work out what the 'quantity' flag actually does? If I have a lockable resource called 'abc' and I say  lock (resource: 'abc', quantity: 3) , what does that actually do? I expected to somewhere set the maximum number of things available to lock within 'abc' and then the pipeline scripts could acquire 3 of them, but I don't see how to set the max. So it acquires 3, out of...?
            Hide
            rbjorklin Robin Björklin added a comment -

            t stibbs Did you figure out how to set the maximum? I'm facing the same lack of documentation as you.

            Show
            rbjorklin Robin Björklin added a comment - t stibbs Did you figure out how to set the maximum? I'm facing the same lack of documentation as you.
            Hide
            aries1980 Janos Feher added a comment - - edited

            Robin Björklin, t stibbs: you need to copy the instance multiple times and group them by label. So you create

            • resource1, label: my_resource
            • resource2, label: my_resource
            • resource3, label: my_resource
            • resource4, label: my_resource
            • resource5, label: my_resource

            Now you have my_resource with a quantity of 5.

            Show
            aries1980 Janos Feher added a comment - - edited Robin Björklin , t stibbs : you need to copy the instance multiple times and group them by label. So you create resource1, label: my_resource resource2, label: my_resource resource3, label: my_resource resource4, label: my_resource resource5, label: my_resource Now you have my_resource with a quantity of 5.

              People

              • Assignee:
                amuniz Antonio Muñiz
                Reporter:
                amuniz Antonio Muñiz
              • Votes:
                7 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: