Skip to content

Commit

Permalink
fix(deadline): fix UsageBasedLicensing stack updates (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jusiskin authored Jul 31, 2020
1 parent 9e95e04 commit 84e09fb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/aws-rfdk/lib/deadline/lib/usage-based-licensing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ export class UsageBasedLicensing extends Construct implements IGrantable {
taskDefinition,
desiredCount: props.desiredCount,
placementConstraints: [PlacementConstraint.distinctInstances()],
// This is required to right-size our host capacity and not have the ECS service block on updates. We set a memory
// reservation, but no memory limit on the container. This allows the container's memory usage to grow unbounded.
// We want 1:1 container to container instances to not over-spend, but this comes at the price of down-time during
// cloudformation updates.
minHealthyPercent: 0,
maxHealthyPercent: 100,
});

this.node.defaultChild = this.service;
Expand Down
20 changes: 20 additions & 0 deletions packages/aws-rfdk/lib/deadline/test/usage-based-licensing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@ beforeEach(() => {
});
});

test('configures deployment configuration', () => {
// WHEN
new UsageBasedLicensing(stack, 'licenseForwarder', {
vpc,
images,
certificateSecret: certSecret,
memoryLimitMiB: 1024,
licenses: [UsageBasedLicense.forVray()],
renderQueue,
});

// THEN
expectCDK(stack).to(haveResourceLike('AWS::ECS::Service', {
DeploymentConfiguration: {
MaximumPercent: 100,
MinimumHealthyPercent: 0,
},
}));
});

test('default ECS stack for License Forwarder is created correctly', () => {
// WHEN
new UsageBasedLicensing(stack, 'licenseForwarder', {
Expand Down

0 comments on commit 84e09fb

Please sign in to comment.