Skip to content

Commit

Permalink
feat(glue): Add G.4X and G.8X worker types for AWS Glue (#25637)
Browse files Browse the repository at this point in the history
Adds new worker types for Glue announced in: https://aws.amazon.com/about-aws/whats-new/2023/05/aws-glue-large-instance-types-generally-available/

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
racc authored May 24, 2023
1 parent a86b919 commit 1e4ffcd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-glue-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ new glue.Job(this, 'ScalaSparkEtlJob', {
className: 'com.example.HelloWorld',
extraJars: [glue.Code.fromBucket(bucket, 'jars/HelloWorld.jar')],
}),
workerType: glue.WorkerType.G_8X,
description: 'an example Scala ETL job',
});
```
Expand Down
10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-glue-alpha/lib/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ export class WorkerType {
*/
public static readonly G_2X = new WorkerType('G.2X');

/**
* Each worker maps to 4 DPU (16 vCPU, 64 GB of memory, 256 GB disk), and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for AWS Glue version 3.0 or later jobs.
*/
public static readonly G_4X = new WorkerType('G.4X');

/**
* Each worker maps to 8 DPU (32 vCPU, 128 GB of memory, 512 GB disk), and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for AWS Glue version 3.0 or later jobs.
*/
public static readonly G_8X = new WorkerType('G.8X');

/**
* Each worker maps to 0.25 DPU (2 vCPU, 4 GB of memory, 64 GB disk), and provides 1 executor per worker. Suitable for low volume streaming jobs.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"key": "value"
},
"Timeout": 5,
"WorkerType": "G.2X"
"WorkerType": "G.1X"
}
},
"EtlJob20SuccessMetricRule1759F889": {
Expand Down Expand Up @@ -547,7 +547,7 @@
"key": "value"
},
"Timeout": 5,
"WorkerType": "G.2X"
"WorkerType": "G.1X"
}
},
"EtlJob30SuccessMetricRuleF8870F8A": {
Expand Down Expand Up @@ -904,7 +904,7 @@
"key": "value"
},
"Timeout": 5,
"WorkerType": "G.2X"
"WorkerType": "G.1X"
}
},
"EtlJob40SuccessMetricRule00D3EF34": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
"key": "value"
},
"timeout": 5,
"workerType": "G.2X"
"workerType": "G.1X"
}
},
"constructInfo": {
Expand Down Expand Up @@ -808,7 +808,7 @@
"key": "value"
},
"timeout": 5,
"workerType": "G.2X"
"workerType": "G.1X"
}
},
"constructInfo": {
Expand Down Expand Up @@ -1324,7 +1324,7 @@
"key": "value"
},
"timeout": 5,
"workerType": "G.2X"
"workerType": "G.1X"
}
},
"constructInfo": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/test/integ.job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const script = glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.
glueVersion,
script,
}),
workerType: glue.WorkerType.G_2X,
workerType: glue.WorkerType.G_1X,
workerCount: 10,
maxConcurrentRuns: 2,
maxRetries: 2,
Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-glue-alpha/test/job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ describe('WorkerType', () => {

test('.G_2X should set the name correctly', () => expect(glue.WorkerType.G_2X.name).toEqual('G.2X'));

test('.G_4X should set the name correctly', () => expect(glue.WorkerType.G_4X.name).toEqual('G.4X'));

test('.G_8X should set the name correctly', () => expect(glue.WorkerType.G_8X.name).toEqual('G.8X'));

test('.G_025X should set the name correctly', () => expect(glue.WorkerType.G_025X.name).toEqual('G.025X'));

test('.Z_2X should set the name correctly', () => expect(glue.WorkerType.Z_2X.name).toEqual('Z.2X'));
Expand Down

0 comments on commit 1e4ffcd

Please sign in to comment.