Skip to content

Feature: Serverless Endpoint #193

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

Merged
merged 3 commits into from
Jan 20, 2023

Conversation

ananth102
Copy link
Member

@ananth102 ananth102 commented Jan 19, 2023

Issue #, if available:

Description of changes:

This pull request contains code/unit tests for the Serverless Endpoint.
Changes made:
generator.yaml - Uncommenting shape and adding hook.
pkg/resource/endpoint_config/custom_delta.go - Code that handles server side default. Late initialization isnt possible because this field is an array.
testdata/ - Unit tests

The Server returns a value for VolumeSizeInGB despite it being a parameter the user cannot even specify while using a serverless endpoint. The same problem is not there for an instance based endpoint config.

Manual testing (Will delete this before merge):

Endpoint Config:

[Serverless] Async Conifg - Validation Exception
[Serverless] Multi Variant - Validation Exception
[Serverless] Data Capture - Validation Exception
[Serverless] Including VolumeSizeInGB in spec: Validation exception
[Serverless] No VolumeSizeInGB: Normal reconciliation, no errors after restart.
[Normal] No VolumeSizeInGB - Normal reconciliation, no errors after restart.
[Normal] VolumeSizeInGB - Normal reconciliation, no errors after restart.

Endpoint:
Launching Serverless: Works, user sees information in PendingDeploymentSummary
Updating Instance→ Serverless: Validation Exception
Updating Serverless → Instance: Production variant must have a different name, works.

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

"MemorySizeInMB": 1024
},
"VariantName": "AllTraffic",
"VolumeSizeInGB": 5
Copy link
Member

Choose a reason for hiding this comment

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

hmm, lets try to also get answer from service team on why the behavior is like this? wouldnt it confuse the user

if ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) && ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) {
if len(a.ko.Spec.ProductionVariants) == len(b.ko.Spec.ProductionVariants) {
for i, _ := range a.ko.Spec.ProductionVariants {
if a.ko.Spec.ProductionVariants[i].VolumeSizeInGB == nil && b.ko.Spec.ProductionVariants[i].VolumeSizeInGB != nil {
Copy link
Member

Choose a reason for hiding this comment

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

lets add another check here, do it only if variant.ServerlessConfig != nil?

nit: add a comment here for why we have custom code, since server side default doesn't handle slices

Copy link
Member

@surajkota surajkota left a comment

Choose a reason for hiding this comment

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

/approve

if ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) && ackcompare.IsNotNil(a.ko.Spec.ProductionVariants) {
if len(a.ko.Spec.ProductionVariants) == len(b.ko.Spec.ProductionVariants) {
for i, _ := range a.ko.Spec.ProductionVariants {
if a.ko.Spec.ProductionVariants[i].ServerlessConfig != nil {
Copy link
Member

Choose a reason for hiding this comment

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

nit: this can be one if statement

@surajkota
Copy link
Member

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2023
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ananth102, surajkota

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [ananth102,surajkota]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit eb3671e into aws-controllers-k8s:main Jan 20, 2023
ryansteakley pushed a commit to ryansteakley/sagemaker-controller that referenced this pull request Jan 19, 2024
Issue #, if available:

Description of changes:

This pull request contains code/unit tests for the Serverless Endpoint.
Changes made:
`generator.yaml` - Uncommenting shape and adding hook.
`pkg/resource/endpoint_config/custom_delta.go` - Code that handles server side default. Late initialization isnt possible because this field is an array.
`testdata/` - Unit tests

The Server returns a value for VolumeSizeInGB despite it being a parameter the user cannot even specify while using a serverless endpoint. The same problem is not there for an instance based endpoint config.

Manual testing (Will delete this before merge):

Endpoint Config:

[Serverless] Async Conifg - Validation Exception
[Serverless] Multi Variant - Validation Exception
[Serverless] Data Capture - Validation Exception
[Serverless] Including VolumeSizeInGB in spec: Validation exception
[Serverless] No VolumeSizeInGB: Normal reconciliation, no errors after restart.
[Normal] No VolumeSizeInGB - Normal reconciliation, no errors after restart.
[Normal] VolumeSizeInGB - Normal reconciliation, no errors after restart.

Endpoint:
Launching Serverless: Works, user sees information in PendingDeploymentSummary
Updating Instance→ Serverless: Validation Exception
Updating Serverless → Instance: Production variant must have a different name, works.


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
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants