You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

What is a Shared Resource?

Shared resources are used in Continua CI to restrict the number of builds or stages accessing the same resource concurrently. This can be useful if you wish to limit the number of times a particular tool is run due to a license or memory limit, or to prevent concurrency issues with multiple build stages simultaneously writing to the same file, folder or network resource. 

Each shared resource has an allocation of locks which can be acquired and held by builds or stages. This locks are allocated at server or agent level.

Server Shared Resource locks can be acquired while evaluating configuration conditions and also while selecting an agent. Any builds which require Server Shared Resource locks, which are held by other builds, will wait on the build queue or stage queue until the required locks are released.

Agent Shared Resource locks are allocated per agent and can be acquired when an agent is selected for a stage. Continua CI will chose the agent with the highest available allocation of the required locks. If there are no Agent Shared Resource locks available for any available agent, the build will wait on the stage queue until the required locks are released.  

Shared resource locks are automatically released at the end of the build or stage which acquired the lock.

Types of Shared Resource

Single: A single read or write lock. Only one build or stage can acquire a lock on this Shared Resource at any time. This is useful if build actions require exclusive access to a resource on a server or agent 

Infinite: Any number of read locks. A single write lock. Any number of builds or stages can acquire read locks on this Shared Resource. Only one build or stage can acquire a write lock on this Shared Resource at any time. A write lock can only be acquired if no read locks are held.

Quota: Fixed number of read locks. A single write lock. A specified number of builds or stages can acquire read locks on this Shared Resource. Only one build or stage can acquire a write lock on this Shared Resource at any time. A write lock can only be acquired if no read locks are held.

Quota List: The quota allocation is split into a number of labelled quotas. Fixed number of read locks per label. A single write lock per label. A specified number of builds or stages can acquire read locks on each label defined on this Shared Resource. Only one build or stage can acquire a write lock on each label of this Shared Resource at any time. A write lock can only be acquired if no read locks are held on the specified label. You can acquire locks on all labels at once or acquire any available label.

Creating and Editing Shared Resources

Server Shared Resources

Server Shared Resources can be created and edited in the Shared Resources section of the Administration pages

 

Click on the Create button to add a new Shared Resource. Edit and Delete buttons are available next to existing shared resources. 

 

Namespace and Name

The unique identifier for this shared resource. The namespace can be used for grouping similar shared resource types. Note that the shared resource namespace and name cannot contain spaces or other special characters.

Type

The type of shared resource: single, infinite or quota or quota list. See above for a description of each of these shared resource types.

Quota

The number of read locks allocated for a Quota Shared Resource.

Label and Quota

You can add multiple labels to a Quota List Shared Resource each with a separate quota allocation. 

Agent Shared Resources

Agent Shared Resources can be viewed by clicking on an Agent in the Agents section of the Administration pages and opening the Shared Resources tab. 

 

Click on the Create button to add a new Agent Shared Resource. Edit and Delete buttons are available next to existing agent  shared resources. 

A tick next to the shared resource indicates that a quota is allocated to it. A shared resource created for one agent will be shown on Shared Resources tab for other agents but without any allocation. 

 

Namespace and Name

The identifier for this agent shared resource. This must be unique across all agents.  The namespace can be used for grouping similar shared resource types. Note that the shared resource namespace and name cannot contain spaces or other special characters.

Type

The type of shared resource: single, infinite or quota or quota list. See above for a description of each of these shared resource types.

 

Quota

The number of read locks allocated to the agent for a Quota agent shared resource.

 

 

Label and Quota

You can add multiple labels to a Quota List agent shared resource each with a separate quota allocation. Allocations are specific to the agent.

 

Setting Up Builds to Acquire Shared Resources

 

 

  • No labels