Working with Resources

Version 2 by Robin Shen
on Aug 30, 2011 05:32.


compared with
Version 3 by Robin Shen
on Aug 30, 2011 06:26.


Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 3 changes. View first change.

 h1. What is Resource
  
 Resource means any physical or virtual component of limited availability within the grid, and is provided by grid node. A build step can declare to require certain resources to run. If some nodes are found with desired resources, the step will run on the fastest node; otherwise, the step will wait until a node with free resource is available. This way, the resource contention problem between builds and steps can be solved efficiently.
  
For instance, we can define a CPU resource representing all CPUs of all agents in the grid, and declare that master step of the build requires the CPU resource. This guarantees that a CPU will run one and only one build. If CPU resource is currently used up, new build requests will wait until there is a free one. Another example is that you have a single deployment machine in your grid, and only one deployment step can deploy to that machine in the same time. In this case, you may define a deployment resource corresponding to that machine, and for each deploy step, define it to require the deployment resource.
  For instance, we can define the CPU processor resource representing all CPU processors of all agents in the grid, and declare that master step of the build requires the processor resource. This guarantees that a processor will run one and only one build. If processor resource is currently used up, new build requests will wait until there is a free one. Another example is that you have a single deployment machine in your grid, and only one deployment step can deploy to that machine in the same time. In this case, you may define a deployment resource corresponding to that machine, and for each deploy step, define it to require the deployment resource.
  
 h1. Define Resources
  
 Resource can be defined in the resource tab. When define a resource, you will need to specify which grid node will provide the resource, and how many it will provide. Below screenshot defines a CPU processor resource, and all build agents can provide this resource, with the resource count set to system property _qb.processor.number_: