Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 2b1d630

Browse files
vgkowskialexvt-amzlmouhib
authored
Feat: emr on eks data platform (#187)
* initial version or emr on eks construct * added correct dependency for js-yaml * upgrading projen and changing dependencies specification in .projenrc.js * refactoring emr on eks * refactor EKS cluster creation * updated constructs (not finished) * changes to make original version jsii-compliant * fix to make cdk deploy compile successfully * cdk deploys successfully * stack is in deployable state: cluster autoscaler needs fixing * cluster autoscaler is fixed * comments & cleanup * first draft for managed endpoint based on lambda custom resource, not functional at the moment * changed client name variable to avoid scope confusion (raised by Lotfi) * fix: managed endpoint now works, todo: sort out generation of ssl certificate * fix: add timeout, format changes * added security groups needs for emrstudio * fix: support multiple managed endpoints * added executionRoleArn as props * fix: nodegroup taints, added configurationOverride * upgrade cdk * feature: nodegroup improvements and code refactoring * fix: nodegroup taints and unit tests * fix: tooling nodegroup labels for cluster autoscaler * fix: added check on managedendpoint name lenght to be less than or equal to 64 * fix: add waiting for the endpoint termination status * add license * add managed endpoint dependency on eksCluster * fix: simplify code in emr virtual cluster * change execution role creation * refactoring managed endpoint * adding default EMR config and pod templates for default nodegroups * refactoring managed endpoint custom resource * fix: change in addManagedEndpoint in emr-eks-cluster.ts to support multistack, function now has one more parameter to take the scope of the a stack. * fix: check constraint on namespace before its creation, only allowing lowercase alphanumeric * fix: fix in emr-eks-cluster.ts to pass the test case and scoped the CR permissions * fix: issues with scoped policy for CR in emr-eks-cluster.ts * added a workaround for pod templates in notebook * added unique service token to the managed endpoint CR lambda Co-authored-by: Alex Tarasov <alexvt@amazon.com> Co-authored-by: Lotfi Mouhib <mouhib@amazon.com> Co-authored-by: Vincent Gromakowski <gromav@amazon.com>
1 parent 7a8880c commit 2b1d630

40 files changed

+3331
-286
lines changed

CONTRIB_FAQ.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ See the `Dataset` class using static variables call the class constructor [here]
138138

139139
### How to implement Singleton pattern for an AWS CDK resource
140140

141+
A singleton resource can have different scope:
142+
* Across stacks: if you don't need to version it and it's the same resource across all AWS CDK Applications
143+
* Within stacks: if the resource can evolve across versions, it's preferable to scope it to a stack and assign a unique ID
144+
145+
#### Within stacks
146+
141147
The singleton pattern can be implemented using the unique ID of the AWS CDK node. Instead of creating a new resource from the AWS CDK Construct, a static `getOrCreate` method is used to retrieve the resource by search for the unique ID in the AWS CDK Scope. If no resource exists, the method creates a new one.
142148

143149
See the `SingletonBucket` Construct [here](./core/src/singleton-bucket.ts).

core/.projen/deps.json

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

core/.projen/tasks.json

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

core/.projenrc.js

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: MIT-0
3+
34
const { basename, join, dirname, relative } = require('path');
45
const glob = require('glob');
56

67

7-
const { AwsCdkConstructLibrary, DependenciesUpgradeMechanism } = require('projen');
8+
const { AwsCdkConstructLibrary, DependenciesUpgradeMechanism, Semver } = require('projen');
9+
810
const project = new AwsCdkConstructLibrary({
911

1012
authorName: 'Amazon Web Services',
@@ -23,7 +25,7 @@ const project = new AwsCdkConstructLibrary({
2325

2426
cdkVersion: '1.130',
2527
defaultReleaseBranch: 'main',
26-
license: 'MIT',
28+
license: 'MIT-0',
2729
name: 'aws-analytics-reference-architecture',
2830
repositoryUrl: 'https://github.com/aws-samples/aws-analytics-reference-architecture.git',
2931
repositoryDirectory: 'core',
@@ -36,46 +38,59 @@ const project = new AwsCdkConstructLibrary({
3638
cdkVersionPinning: true,
3739

3840
cdkDependencies: [
39-
'@aws-cdk/core',
40-
'@aws-cdk/custom-resources',
41-
'@aws-cdk/aws-logs',
42-
'@aws-cdk/aws-lambda',
43-
'@aws-cdk/aws-lambda-python',
44-
'@aws-cdk/aws-s3',
45-
'@aws-cdk/aws-kinesis',
41+
'@aws-cdk/assertions',
42+
'@aws-cdk/aws-athena',
43+
'@aws-cdk/aws-autoscaling',
44+
'@aws-cdk/aws-ec2',
45+
'@aws-cdk/aws-emrcontainers',
46+
'@aws-cdk/aws-eks',
47+
'@aws-cdk/aws-events',
48+
'@aws-cdk/aws-events-targets',
49+
'@aws-cdk/aws-glue',
4650
'@aws-cdk/aws-iam',
51+
'@aws-cdk/aws-kinesis',
4752
'@aws-cdk/aws-kinesisfirehose',
4853
'@aws-cdk/aws-kinesisfirehose-destinations',
49-
'@aws-cdk/aws-kinesis',
54+
'@aws-cdk/aws-lambda',
55+
'@aws-cdk/aws-lambda-python',
5056
'@aws-cdk/aws-logs',
51-
'@aws-cdk/aws-glue',
52-
'@aws-cdk/aws-athena',
53-
'@aws-cdk/aws-glue',
54-
'@aws-cdk/aws-stepfunctions',
55-
'@aws-cdk/aws-stepfunctions-tasks',
56-
'@aws-cdk/aws-events',
57-
'@aws-cdk/aws-events-targets',
58-
'@aws-cdk/aws-s3-deployment',
59-
'@aws-cdk/aws-ec2',
6057
'@aws-cdk/aws-redshift',
61-
'@aws-cdk/aws-secretsmanager',
58+
'@aws-cdk/aws-s3',
6259
'@aws-cdk/aws-s3-assets',
63-
'@aws-cdk/assertions',
64-
],
65-
bundledDeps: [
66-
'xmldom@github:xmldom/xmldom#0.7.0',
67-
'aws-sdk',
60+
'@aws-cdk/aws-s3-deployment',
61+
'@aws-cdk/aws-secretsmanager',
62+
'@aws-cdk/aws-stepfunctions',
63+
'@aws-cdk/aws-stepfunctions-tasks',
64+
'@aws-cdk/core',
65+
'@aws-cdk/custom-resources',
66+
'@aws-cdk/lambda-layer-awscli',
6867
],
6968

7069
devDeps: [
70+
'@types/js-yaml',
71+
'@types/jest',
7172
'esbuild',
7273
],
7374

75+
bundledDeps: [
76+
'js-yaml',
77+
'uuid',
78+
'aws-sdk',
79+
],
80+
7481
python: {
7582
distName: 'aws_analytics_reference_architecture',
7683
module: 'aws_analytics_reference_architecture',
7784
},
7885

86+
tsconfig: {
87+
compilerOptions: {
88+
resolveJsonModule: true,
89+
esModuleInterop: true,
90+
},
91+
include: ['src/**/*.json', 'src/**/*.ts'],
92+
},
93+
7994
stability: 'experimental',
8095

8196
});

0 commit comments

Comments
 (0)