-
Notifications
You must be signed in to change notification settings - Fork 249
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-apigateway-sagemakerendpoint): New aws-apigateway-sagemakerendpoint pattern implementation #87
Conversation
…ndpoint pattern implementation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first cut, few comments to look into
* | ||
* @default - None. | ||
*/ | ||
readonly endpointName: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it support both endpoint name and ARN ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path for the integration has to be endpoints/<sagemaker-endpoint-name>/invocations
, so if ARN was used we'd have to parse it. Is there an example of this in Constructs right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check aws-apigateway-iot
pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I looked, but it's a subdomain there (e.g. ab123cdefghij4l-ats.iot.ap-south-1.amazonaws.com
), which is different than the ARN. I could do something like this:
// Parse endpoint name
try {
const components = Arn.parse(props.sageMakerEndpoint);
// This line is required since resourceName is string | undefined
if (!components.resourceName) {
throw new Error('Provided ARN does not contain resource name');
}
this.sageMakerEndpointName = components.resourceName;
} catch {
this.sageMakerEndpointName = props.sageMakerEndpoint;
}
Would that be enough? I'm not sure if the complexity added is worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not worth the complexity, let's make sure the comments clearly say it expects the endpoint Name and not the ARN of the endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both the interface comment and README file mention name, not ARN (Name of the deployed SageMaker inference endpoint). Is there anywhere I should change it?
source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts
Outdated
Show resolved
Hide resolved
source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts
Outdated
Show resolved
Hide resolved
source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts
Show resolved
Hide resolved
...apigateway-sagemakerendpoint/test/integ.apigateway-sagemakerendpoint-overwrite.expected.json
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thanks for the contribution, the pattern will be published in the next release. |
Issue #, if available: #75
Description of changes: This PR introduces a new pattern, where inference from a deployed model in SageMaker can be done via API Gateway.
As mentioned on the issue, each ML use case is unique and the construct requires certain properties (such as resource path and request mapping template) to be provided. Also, for the documentation (README.md) and integration tests, I've used this blog post as a reference.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.