Skip to content

Commit 16c8234

Browse files
authored
Weathertop: Allow plugin stacks to specify ephemeral storage sizes (#6968)
* Weathertop: Allow plugin stacks to specify ephemeral storage sizes * Document resource types.
1 parent 53514f4 commit 16c8234

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.tools/test/stacks/config/targets.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import { parse } from "yaml";
77
interface AccountConfig {
88
account_id: string;
99
status: "enabled" | "disabled";
10-
vcpus?: string;
11-
memory?: string;
10+
// https://docs.aws.amazon.com/batch/latest/APIReference/API_ResourceRequirement.html
11+
vcpus?: string; // Count
12+
memory?: string; // MiB, but limited based on vCPU count, see docs
13+
storage?: string; // GiB, 20GiB to 200GiB
1214
}
1315

1416
interface AccountConfigs {

.tools/test/stacks/plugin/typescript/plugin_stack.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class PluginStack extends cdk.Stack {
2424
private adminAccountId: string;
2525
private batchMemory: string;
2626
private batchVcpus: string;
27+
private batchStorage: string;
2728

2829
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
2930
super(scope, id, props);
@@ -40,8 +41,10 @@ class PluginStack extends cdk.Stack {
4041
const sqsQueue = new sqs.Queue(this, `BatchJobQueue-${toolName}`);
4142
if (acctConfig[`${toolName}`].status === "enabled") {
4243
this.initSubscribeSns(sqsQueue, snsTopic);
43-
this.batchMemory = acctConfig[`${toolName}`]?.memory ?? "16384";
44-
this.batchVcpus = acctConfig[`${toolName}`]?.vcpus ?? "4";
44+
// https://docs.aws.amazon.com/batch/latest/APIReference/API_ResourceRequirement.html
45+
this.batchMemory = acctConfig[`${toolName}`]?.memory ?? "16384"; // MiB
46+
this.batchVcpus = acctConfig[`${toolName}`]?.vcpus ?? "4"; // CPUs
47+
this.batchStorage = acctConfig[`${toolName}`]?.storage ?? "20"; // GiB
4548
}
4649

4750
const [jobDefinition, jobQueue] = this.initBatchFargate();
@@ -137,6 +140,9 @@ class PluginStack extends cdk.Stack {
137140
value: this.batchMemory,
138141
},
139142
],
143+
ephemeralStorage: {
144+
sizeInGib: this.batchStorage,
145+
},
140146
environment: variableConfigJson,
141147
},
142148
platformCapabilities: ["FARGATE"],

0 commit comments

Comments
 (0)