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(scheduler-targets-alpha): SageMakerStartPipelineExecution Target #28927

Merged
merged 15 commits into from
Feb 13, 2024

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Jan 30, 2024

This PR adds SageMakerStartPipelineExecution Target for EventBridge Scheduler.

Closes #27457


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

@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Jan 30, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 30, 2024 16:23
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@go-to-k go-to-k marked this pull request as ready for review February 5, 2024 11:35
@aws-cdk-automation aws-cdk-automation dismissed their stale review February 5, 2024 11:36

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

add an unit test
@go-to-k go-to-k force-pushed the scheduler-targets-sagemaker branch from cc5b6cd to 5a30af5 Compare February 5, 2024 11:43
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 5, 2024
private readonly pipelineArn: string;

constructor(
private readonly pipeline: CfnPipeline,
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything is fine except for this... it should be an IPipeline but that doesn't exist yet. The problem is that this locks in people to the L1 pipeline, and ideally we'd want this to be interoperable with a community L2 if that existed.

So how about adding a very barebones IPipeline construct to aws-sagemaker. Nothing controversial, just kind of a placeholder. In the future, if we develop a Pipeline L2, it can build off of the IPipeline as can any community L2. As long as we don't make any crazy decisions, this can be stable from day 1. We did something similar in IEndpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.
The IEndpoint is also creating an interface in the aws-sagemaker-alpha module, but that is to ensure that the existing implementation is not affected, so is it correct to create it only in the aws-sagemaker module for this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

@go-to-k one comment about how we are using sagemaker And one other comment -- can you make sure that the references to sagemaker are SageMaker with the capital M?

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 6, 2024
@go-to-k
Copy link
Contributor Author

go-to-k commented Feb 7, 2024

@kaizencc

Thanks for your review.

can you make sure that the references to sagemaker are SageMaker with the capital M?

Oh, It seems that the CFn documents SageMaker with the capital M.
But I had been written Sagemaker without the capital M in some points, so I will fix them.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-pipeline.html

@go-to-k
Copy link
Contributor Author

go-to-k commented Feb 7, 2024

It seems that the CFn documents SageMaker with the capital M.

However, it seems that many places have already written Sagemaker in some codes. Let's not swing to them and use SageMaker only in this PR.

https://github.com/go-to-k/aws-cdk/blob/64275fd095cd52daaeba852512a12d6df9664b28/packages/@aws-cdk/aws-sagemaker-alpha/lib/endpoint.ts#L24

https://github.com/go-to-k/aws-cdk/blob/64275fd095cd52daaeba852512a12d6df9664b28/packages/%40aws-cdk/aws-sagemaker-alpha/README.md?plain=1#L26

etc...

PS) I changed.

249220a

@mergify mergify bot dismissed kaizencc’s stale review February 7, 2024 09:41

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 7, 2024
@go-to-k go-to-k requested a review from kaizencc February 7, 2024 10:55
@go-to-k go-to-k force-pushed the scheduler-targets-sagemaker branch 2 times, most recently from 42b6946 to d6d3c59 Compare February 7, 2024 12:03
@go-to-k go-to-k force-pushed the scheduler-targets-sagemaker branch 4 times, most recently from 0e29910 to 0b1df62 Compare February 7, 2024 12:35
Comment on lines 6 to 7
import { CfnPipeline } from 'aws-cdk-lib/aws-sagemaker';
import { IPipeline } from 'aws-cdk-lib/aws-sagemaker';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got the following eslint error when I did the following here, so here it is

import { CfnPipeline, IPipeline } from 'aws-cdk-lib/aws-sagemaker';
❯ yarn lint
yarn run v1.22.17
$ cdk-lint

Oops! Something went wrong! :(

ESLint: 7.32.0

Error: ENOENT: no such file or directory, open '/Users/goto/github/aws-cdk/packages/aws-cdk-lib/aws-sagemaker/package.json'
Occurred while linting /Users/goto/github/aws-cdk/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.sage-maker-start-pipeline-execution.ts:6
    at Object.openSync (node:fs:600:3)
    at Object.readFileSync (node:fs:468:35)
    at isAlphaPackage (/Users/goto/github/aws-cdk/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js:139:31)
    at checkIfImportedLocationIsAnAlphaPackage (/Users/goto/github/aws-cdk/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js:118:16)
    at ImportDeclaration (/Users/goto/github/aws-cdk/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js:55:74)
    at /Users/goto/github/aws-cdk/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/goto/github/aws-cdk/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/goto/github/aws-cdk/node_modules/eslint/lib/linter/node-event-generator.js:293:26)
    at NodeEventGenerator.applySelectors (/Users/goto/github/aws-cdk/node_modules/eslint/lib/linter/node-event-generator.js:322:22)
Error: /Users/goto/github/aws-cdk/node_modules/eslint/bin/eslint.js . --ext=.ts --resolve-plugins-relative-to=/Users/goto/github/aws-cdk/tools/@aws-cdk/cdk-build-tools/lib exited with error code 2
Linting failed.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But duplicated no-duplicate-imports error... I will investigate later.


@aws-cdk/aws-scheduler-targets-alpha: /codebuild/output/src294405110/src/github.com/aws/aws-cdk/packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.sage-maker-start-pipeline-execution.ts
@aws-cdk/aws-scheduler-targets-alpha:   7:1  error  'aws-cdk-lib/aws-sagemaker' import is duplicated  no-duplicate-imports
@aws-cdk/aws-scheduler-targets-alpha: 笨� 1 problem (1 error, 0 warnings)

Copy link
Contributor Author

@go-to-k go-to-k Feb 8, 2024

Choose a reason for hiding this comment

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

The error (Error: ENOENT: no such file or directory...) is about the lint rules.

The error was reduced by changing the settings to match other alpha modules like baseConfig.rules['@aws-cdk/invalid-cfn-imports'] = 'off';.

55fbb20

using IPipeline

grantStartPipelineExecution

tweak

tweak

tweak

fix eslint error

tweak

tweak

tweak
@go-to-k go-to-k force-pushed the scheduler-targets-sagemaker branch from 0b1df62 to 7671cca Compare February 7, 2024 12:43
@go-to-k
Copy link
Contributor Author

go-to-k commented Feb 8, 2024

@kaizencc

The build was successful, reflecting your comments. Could you please check?

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Thanks @go-to-k

Copy link
Contributor

mergify bot commented Feb 13, 2024

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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 13, 2024
Copy link
Contributor

mergify bot commented Feb 13, 2024

Thank you for contributing! Your pull request will be updated from main 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: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 1fc2be5
  • 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 db260b0 into aws:main Feb 13, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Feb 13, 2024

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

GavinZZ pushed a commit that referenced this pull request Feb 22, 2024
…et (#28927)

This PR adds SageMakerStartPipelineExecution Target for EventBridge Scheduler.

Closes #27457

----

*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
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-scheduler-targets-alpha): Add SageMakerStartPipelineExecution Target
3 participants