@aws-cdk_aws-batch-alpha.Share

interface Share ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Batch.Alpha.Share
Gogithub.com/aws/aws-cdk-go/awscdkbatchalpha/v2#Share
Javasoftware.amazon.awscdk.services.batch.alpha.Share
Pythonaws_cdk.aws_batch_alpha.Share
TypeScript (source)@aws-cdk/aws-batch-alpha ยป Share

Represents a group of Job Definitions.

All Job Definitions that declare a share identifier will be considered members of the Share defined by that share identifier.

The Scheduler divides the maximum available vCPUs of the ComputeEnvironment among Jobs in the Queue based on their shareIdentifier and the weightFactor associated with that shareIdentifier.

Example

const fairsharePolicy = new batch.FairshareSchedulingPolicy(this, 'myFairsharePolicy');

fairsharePolicy.addShare({
  shareIdentifier: 'A',
  weightFactor: 1,
});
fairsharePolicy.addShare({
  shareIdentifier: 'B',
  weightFactor: 1,
});
new batch.JobQueue(this, 'JobQueue', {
  schedulingPolicy: fairsharePolicy,
});

Properties

NameTypeDescription
shareIdentifier๐Ÿ”นstringThe identifier of this Share.
weightFactor๐Ÿ”นnumberThe weight factor given to this Share.

shareIdentifier๐Ÿ”น

Type: string

The identifier of this Share.

All jobs that specify this share identifier when submitted to the queue will be considered as part of this Share.


weightFactor๐Ÿ”น

Type: number

The weight factor given to this Share.

The Scheduler decides which jobs to put in the Compute Environment such that the following ratio is equal for each job:

sharevCpu / weightFactor,

where sharevCpu is the total amount of vCPU given to that particular share; that is, the sum of the vCPU of each job currently in the Compute Environment for that share.

See the readme of this module for a detailed example that shows how these are used, how it relates to computeReservation, and how shareDecay affects these calculations.