CfnSchedulingPolicyPropsMixin

class aws_cdk.mixins_preview.aws_batch.mixins.CfnSchedulingPolicyPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::Batch::SchedulingPolicy resource specifies the parameters for an AWS Batch scheduling policy.

For more information, see Scheduling Policies in the ** .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-schedulingpolicy.html

CloudformationResource:

AWS::Batch::SchedulingPolicy

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_batch import mixins as batch_mixins

cfn_scheduling_policy_props_mixin = batch_mixins.CfnSchedulingPolicyPropsMixin(batch_mixins.CfnSchedulingPolicyMixinProps(
    fairshare_policy=batch_mixins.CfnSchedulingPolicyPropsMixin.FairsharePolicyProperty(
        compute_reservation=123,
        share_decay_seconds=123,
        share_distribution=[batch_mixins.CfnSchedulingPolicyPropsMixin.ShareAttributesProperty(
            share_identifier="shareIdentifier",
            weight_factor=123
        )]
    ),
    name="name",
    tags={
        "tags_key": "tags"
    }
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Batch::SchedulingPolicy.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['fairsharePolicy', 'name', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

FairsharePolicyProperty

class CfnSchedulingPolicyPropsMixin.FairsharePolicyProperty(*, compute_reservation=None, share_decay_seconds=None, share_distribution=None)

Bases: object

The fair-share scheduling policy details.

Parameters:
  • compute_reservation (Union[int, float, None]) – A value used to reserve some of the available maximum vCPU for share identifiers that aren’t already used. The reserved ratio is ( *computeReservation* /100)^ *ActiveFairShares* where *ActiveFairShares* is the number of active share identifiers. For example, a computeReservation value of 50 indicates that AWS Batch reserves 50% of the maximum available vCPU if there’s only one share identifier. It reserves 25% if there are two share identifiers. It reserves 12.5% if there are three share identifiers. A computeReservation value of 25 indicates that AWS Batch should reserve 25% of the maximum available vCPU if there’s only one share identifier, 6.25% if there are two fair share identifiers, and 1.56% if there are three share identifiers. The minimum value is 0 and the maximum value is 99.

  • share_decay_seconds (Union[int, float, None]) – The amount of time (in seconds) to use to calculate a fair-share percentage for each share identifier in use. A value of zero (0) indicates the default minimum time window (600 seconds). The maximum supported value is 604800 (1 week). The decay allows for more recently run jobs to have more weight than jobs that ran earlier. Consider adjusting this number if you have jobs that (on average) run longer than ten minutes, or a large difference in job count or job run times between share identifiers, and the allocation of resources doesn’t meet your needs.

  • share_distribution (Union[IResolvable, Sequence[Union[IResolvable, ShareAttributesProperty, Dict[str, Any]]], None]) – An array of SharedIdentifier objects that contain the weights for the share identifiers for the fair-share policy. Share identifiers that aren’t included have a default weight of 1.0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-fairsharepolicy.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_batch import mixins as batch_mixins

fairshare_policy_property = batch_mixins.CfnSchedulingPolicyPropsMixin.FairsharePolicyProperty(
    compute_reservation=123,
    share_decay_seconds=123,
    share_distribution=[batch_mixins.CfnSchedulingPolicyPropsMixin.ShareAttributesProperty(
        share_identifier="shareIdentifier",
        weight_factor=123
    )]
)

Attributes

compute_reservation

A value used to reserve some of the available maximum vCPU for share identifiers that aren’t already used.

The reserved ratio is ( *computeReservation* /100)^ *ActiveFairShares* where *ActiveFairShares* is the number of active share identifiers.

For example, a computeReservation value of 50 indicates that AWS Batch reserves 50% of the maximum available vCPU if there’s only one share identifier. It reserves 25% if there are two share identifiers. It reserves 12.5% if there are three share identifiers. A computeReservation value of 25 indicates that AWS Batch should reserve 25% of the maximum available vCPU if there’s only one share identifier, 6.25% if there are two fair share identifiers, and 1.56% if there are three share identifiers.

The minimum value is 0 and the maximum value is 99.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-fairsharepolicy.html#cfn-batch-schedulingpolicy-fairsharepolicy-computereservation

share_decay_seconds

The amount of time (in seconds) to use to calculate a fair-share percentage for each share identifier in use.

A value of zero (0) indicates the default minimum time window (600 seconds). The maximum supported value is 604800 (1 week).

The decay allows for more recently run jobs to have more weight than jobs that ran earlier. Consider adjusting this number if you have jobs that (on average) run longer than ten minutes, or a large difference in job count or job run times between share identifiers, and the allocation of resources doesn’t meet your needs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-fairsharepolicy.html#cfn-batch-schedulingpolicy-fairsharepolicy-sharedecayseconds

share_distribution

An array of SharedIdentifier objects that contain the weights for the share identifiers for the fair-share policy.

Share identifiers that aren’t included have a default weight of 1.0 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-fairsharepolicy.html#cfn-batch-schedulingpolicy-fairsharepolicy-sharedistribution

ShareAttributesProperty

class CfnSchedulingPolicyPropsMixin.ShareAttributesProperty(*, share_identifier=None, weight_factor=None)

Bases: object

Specifies the weights for the share identifiers for the fair-share policy.

Share identifiers that aren’t included have a default weight of 1.0 .

Parameters:
  • share_identifier (Optional[str]) – A share identifier or share identifier prefix. If the string ends with an asterisk (*), this entry specifies the weight factor to use for share identifiers that start with that prefix. The list of share identifiers in a fair-share policy can’t overlap. For example, you can’t have one that specifies a shareIdentifier of UserA* and another that specifies a shareIdentifier of UserA1 . There can be no more than 500 share identifiers active in a job queue. The string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).

  • weight_factor (Union[int, float, None]) – The weight factor for the share identifier. The default value is 1.0. A lower value has a higher priority for compute resources. For example, jobs that use a share identifier with a weight factor of 0.125 (1/8) get 8 times the compute resources of jobs that use a share identifier with a weight factor of 1. The smallest supported value is 0.0001, and the largest supported value is 999.9999.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_batch import mixins as batch_mixins

share_attributes_property = batch_mixins.CfnSchedulingPolicyPropsMixin.ShareAttributesProperty(
    share_identifier="shareIdentifier",
    weight_factor=123
)

Attributes

share_identifier

A share identifier or share identifier prefix.

If the string ends with an asterisk (*), this entry specifies the weight factor to use for share identifiers that start with that prefix. The list of share identifiers in a fair-share policy can’t overlap. For example, you can’t have one that specifies a shareIdentifier of UserA* and another that specifies a shareIdentifier of UserA1 .

There can be no more than 500 share identifiers active in a job queue.

The string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html#cfn-batch-schedulingpolicy-shareattributes-shareidentifier

weight_factor

The weight factor for the share identifier.

The default value is 1.0. A lower value has a higher priority for compute resources. For example, jobs that use a share identifier with a weight factor of 0.125 (1/8) get 8 times the compute resources of jobs that use a share identifier with a weight factor of 1.

The smallest supported value is 0.0001, and the largest supported value is 999.9999.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-schedulingpolicy-shareattributes.html#cfn-batch-schedulingpolicy-shareattributes-weightfactor