Skip to content

Commit 84c6f54

Browse files
dacortlmouhib
andauthored
feat: Add EMR Serverless runtimeConf and recent EMR release versions (#313)
* Add EMR Serverless runtime and recent EMR release versions --------- Co-authored-by: lmouhib <mouhib.lotfi@gmail.com>
1 parent c9e196c commit 84c6f54

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed

framework/API.md

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

framework/src/processing/lib/emr-releases.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
*/
77

88
export enum EmrRuntimeVersion {
9+
V7_0 = 'emr-7.0.0',
10+
V6_15 = 'emr-6.15.0',
11+
V6_14 = 'emr-6.14.0',
12+
V6_13 = 'emr-6.13.0',
913
V6_12 = 'emr-6.12.0',
1014
V6_11_1 = 'emr-6.11.1',
1115
V6_11 = 'emr-6.11.0',
@@ -29,6 +33,10 @@ const EMR_EKS_IMAGE_URL = 'public.ecr.aws/emr-on-eks/spark/';
2933
* The list of supported Spark images to use in the SparkCICDPipeline.
3034
*/
3135
export enum SparkImage {
36+
EMR_7_0 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V7_0 + ':latest',
37+
EMR_6_15 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V6_15 + ':latest',
38+
EMR_6_14 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V6_14 + ':latest',
39+
EMR_6_13 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V6_13 + ':latest',
3240
EMR_6_12 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V6_12 + ':latest',
3341
EMR_6_11 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V6_11 + ':latest',
3442
EMR_6_10 = EMR_EKS_IMAGE_URL + EmrRuntimeVersion.V6_10 + ':latest',

framework/src/processing/lib/spark-runtime/emr-serverless/spark-emr-runtime-serverless-props.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export interface SparkEmrServerlessRuntimeProps {
5050
* The image configuration.
5151
*/
5252
readonly imageConfiguration?: IResolvable | aws_emrserverless.CfnApplication.ImageConfigurationInputProperty;
53+
/**
54+
* The runtime and monitoring configurations to used as defaults for all of the job runs of this application.
55+
*/
56+
readonly runtimeConfiguration?: IResolvable | aws_emrserverless.CfnApplication.ConfigurationObjectProperty[];
5357
/**
5458
* The configuration for an application to automatically stop after a certain amount of time being idle.
5559
*/

framework/test/unit/processing/spark-runtime-serverless.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@ import { Match, Template } from 'aws-cdk-lib/assertions';
1414
import { AccountRootPrincipal, PolicyDocument, PolicyStatement, Role } from 'aws-cdk-lib/aws-iam';
1515
import { EmrRuntimeVersion, SparkEmrServerlessRuntime } from '../../../src/processing';
1616

17+
describe('Create an EMR Serverless Application with runtime configuration', () => {
18+
19+
const app = new App();
20+
const stack = new Stack(app, 'Stack');
21+
22+
new SparkEmrServerlessRuntime(stack, 'SparkRuntimeServerlessStack', {
23+
releaseLabel: EmrRuntimeVersion.V6_15,
24+
name: 'spark-serverless-demo',
25+
runtimeConfiguration: [{ classification: 'spark-defaults', properties: { 'spark.driver.cores': '4' } }],
26+
});
27+
28+
const template = Template.fromStack(stack);
29+
30+
test('EMR Serverless application created with default config', () => {
31+
template.hasResource('AWS::EMRServerless::Application',
32+
Match.objectLike({
33+
Properties: {
34+
RuntimeConfiguration: [{ Classification: 'spark-defaults', Properties: { 'spark.driver.cores': '4' } }],
35+
},
36+
}),
37+
);
38+
});
39+
});
40+
1741

1842
describe('Create an EMR Serverless Application for Spark and grant access', () => {
1943

0 commit comments

Comments
 (0)