Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-kinesisanalyticsv2): L2 construct for Flink applications #12464

Merged
merged 48 commits into from
Feb 9, 2021

Conversation

mitchlloyd
Copy link
Contributor

@mitchlloyd mitchlloyd commented Jan 11, 2021

Opened for #12407.

Notes for review:

  1. Flink and SQL applications share almost no properties so having separate ka.FlinkApplication and ka.SqlApplication constructs seems correct. I can't see why these would even share an abstract base class.
  2. I'm trying to focus on shipping the Flink construct before SQL since they are so different and I haven't used an SQL application.
  3. I unested lots of the configuration for discoverability. The Cfn naming is verbose (usually with prefixes) so collisions are unlikely. This is a pretty good example of using CDK today to build a Flink app.

Running List of Open Questions

  1. aws-kinesisanalytics exports both aws-kinesisanalytics and aws-kinesisanalyticsv2 generated code. How should we resolve this? Currently I've exported aws-kinesisanalyticsv2 from aws-kinesisanalyticsv2 and haven't changed the other package. Kept this package isolated from aws-kinesisanalytics at the expense of duplicate generated code.
  2. I'm not confident with the use cases for the fromAttributes factory. I'd prefer to leave this factory method out in this initial PR if possible, but I'm also open to comments about what use cases this should handle.
  3. All logging options could be flattened into FlinkApplicationProps (e.g. logRentention, logGroupName, logStreamName, logEncryptionKey...). My first thought was to provide a new ka.Logging type that can be passed to customize the logGroup and logStream. There may be some other middle ground that could let users pass in a logGroup and then a logStream. Went with the flat list of props added to FlinkApplicationProps
  4. When I run yarn build I get this error even though I've already tagged the class.
    Was missing a gen yarn script entry.
  5. Should this module become aws-flink-application or aws-kinesisanalytics-flink to side step the confusion of having seemingly unrelated constructs in the same module at the expense of clashing with CloudFormation? New module name: aws-kinesisanalytics-flink.

Todo

  • Inline documentation
  • Add property groups
  • checkpointEnabled
  • minPauseBetweenCheckpoints
  • logLevel
  • metricsLevel
  • autoscalingEnabled
  • parallelism
  • parallelismPerKpu
  • snapshotsEnabled
  • Figure out fromAttributes approach
  • Add log stream
  • Decide on logging options approach
  • Add metrics access
  • Validate application name
  • Integration tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jan 11, 2021

@mergify
Copy link
Contributor

mergify bot commented Jan 11, 2021

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@mitchlloyd mitchlloyd changed the title Start KAV2 README aws-kinesisanalyticsv2: L2 construct for Flink applications Jan 11, 2021
@mitchlloyd mitchlloyd changed the title aws-kinesisanalyticsv2: L2 construct for Flink applications (aws-kinesisanalyticsv2): L2 construct for Flink applications Jan 11, 2021
@mitchlloyd mitchlloyd changed the title (aws-kinesisanalyticsv2): L2 construct for Flink applications feat(aws-kinesisanalyticsv2): L2 construct for Flink applications Jan 12, 2021
@mitchlloyd
Copy link
Contributor Author

@iliapolo Any feedback on the README portion of this PR or is it time to proceed with implementation?

@iliapolo
Copy link
Contributor

@mitchlloyd

@iliapolo Any feedback on the README portion of this PR or is it time to proceed with implementation?

This is great. Let's start with the implementation. I love that you decided to create a concrete construct for Flink rather than creating a generic Application with a bunch of different configuration types 👍

@iliapolo iliapolo self-assigned this Jan 17, 2021
@iliapolo iliapolo added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jan 17, 2021
@github-actions
Copy link

This PR has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jan 25, 2021
@mitchlloyd
Copy link
Contributor Author

mitchlloyd commented Jan 25, 2021

Still working on this. Will update PR description with progress. One important item to consider is how to deal with the fact that the aws-kinesisanalytics module already exports both AWS::KinesisAnalytics and AWS::KinesisAnalyticsV2 generated Cfn code. For now I've exported AWS::KinesisAnalyticsV2 from the aws-kinesisanalyticsv2 module but this means we would have duplicate code in the CDK.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jan 26, 2021
@iliapolo iliapolo assigned skinny85 and unassigned skinny85 and iliapolo Jan 26, 2021
@mitchlloyd
Copy link
Contributor Author

mitchlloyd commented Jan 28, 2021

@skinny85 Would it be possible to get some early feedback on this PR? I've added a list of open questions to the PR description where I could use some guidance.

@skinny85
Copy link
Contributor

@skinny85 Would it be possible to get some early feedback on this PR? I've added a list of open questions to the PR description where I could use some guidance.

I'll take a detailed look tomorrow, I have it on my ToDo list 🙂

@skinny85
Copy link
Contributor

In the meantime, any chance of getting rid of the yarn.lock changes? 🙂

The trade off here is that we won't allow users to control the stream properties.
@mitchlloyd
Copy link
Contributor Author

mitchlloyd commented Feb 8, 2021 via email

@skinny85
Copy link
Contributor

skinny85 commented Feb 8, 2021

aws-lambda-python package is failing with error: Can not find Rust compiler Not sure if this is related to changes in this PR.

That's an unrelated problem, we're working on it!

skinny85
skinny85 previously approved these changes Feb 8, 2021
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the contribution @mitchlloyd !

@mergify mergify bot dismissed skinny85’s stale review February 9, 2021 16:56

Pull request has been modified.

skinny85
skinny85 previously approved these changes Feb 9, 2021
@mergify mergify bot dismissed skinny85’s stale review February 9, 2021 22:38

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Feb 9, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: a91b6b1
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 94279f3 into aws:master Feb 9, 2021
@mitchlloyd mitchlloyd deleted the kinesis-analytics-l2 branch February 10, 2021 22:02
NovakGu pushed a commit to NovakGu/aws-cdk that referenced this pull request Feb 18, 2021
…s#12464)

Opened for aws#12407.

Notes for review:

1. Flink and SQL applications share almost no properties so having separate ka.FlinkApplication and ka.SqlApplication constructs seems correct. I can't see why these would even share an abstract base class.
1. I'm trying to focus on shipping the Flink construct before SQL since they are so different and I haven't used an SQL application.
1. I unested lots of the configuration for discoverability. The Cfn naming is verbose (usually with prefixes) so collisions are unlikely. [This](https://github.com/aws-samples/amazon-kinesis-analytics-streaming-etl/blob/master/cdk/lib/streaming-etl.ts#L100) is a pretty good example of using CDK today to build a Flink app.

Running List of Open Questions
-------------------------------

1. ~aws-kinesisanalytics exports both `aws-kinesisanalytics` and `aws-kinesisanalyticsv2` generated code. How should we resolve this? Currently I've exported `aws-kinesisanalyticsv2` from `aws-kinesisanalyticsv2` and haven't changed the other package.~ Kept this package isolated from aws-kinesisanalytics at the expense of duplicate generated code. 
2. ~I'm not confident with the use cases for the `fromAttributes` factory. I'd prefer to leave this factory method out in this initial PR if possible, but I'm also open to comments about what use cases this should handle.~
3. ~All logging options could be flattened into FlinkApplicationProps (e.g. logRentention, logGroupName, logStreamName, logEncryptionKey...). My first thought was to provide a new `ka.Logging` type that can be passed to customize the logGroup and logStream. There may be some other middle ground that could let users pass in a logGroup and then a logStream.~ Went with the flat list of props added to FlinkApplicationProps
4. ~When I run `yarn build` I get this error even though I've already tagged the class.~
    Was missing a `gen` yarn script entry.
5. ~Should this module become `aws-flink-application` or `aws-kinesisanalytics-flink` to side step the confusion of having seemingly unrelated constructs in the same module at the expense of clashing with CloudFormation?~ New module name: `aws-kinesisanalytics-flink`.

Todo
----

- [x] Inline documentation
- [x] Add property groups
- [x] checkpointEnabled
- [x] minPauseBetweenCheckpoints
- [x] logLevel
- [x] metricsLevel
- [x] autoscalingEnabled
- [x] parallelism
- [x] parallelismPerKpu
- [x] snapshotsEnabled
- [x] Figure out fromAttributes approach
- [x] Add log stream
- [x] Decide on logging options approach
- [x] Add metrics access
- [x] Validate application name
- [x] Integration tests

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this pull request Mar 31, 2022
I PR'd the [original version of the aws-kinesisanalytics-flink constructs](#12464) to CDK. I'm following up to add the missing `metric*` methods according to the [design guidelines](https://github.com/aws/aws-cdk/blob/master/docs/DESIGN_GUIDELINES.md#metrics).

[Reference for Flink Application metrics](https://docs.aws.amazon.com/kinesisanalytics/latest/java/metrics-dimensions.html). I have a few running Flink apps and I was able to see that KPUs are also reported for the Flink apps.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)
  * [x] I don't think conventional metric changes require an update to the README.

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [x] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
StevePotter pushed a commit to StevePotter/aws-cdk that referenced this pull request Apr 27, 2022
…19599)

I PR'd the [original version of the aws-kinesisanalytics-flink constructs](aws#12464) to CDK. I'm following up to add the missing `metric*` methods according to the [design guidelines](https://github.com/aws/aws-cdk/blob/master/docs/DESIGN_GUIDELINES.md#metrics).

[Reference for Flink Application metrics](https://docs.aws.amazon.com/kinesisanalytics/latest/java/metrics-dimensions.html). I have a few running Flink apps and I was able to see that KPUs are also reported for the Flink apps.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)
  * [x] I don't think conventional metric changes require an update to the README.

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [x] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants