Skip to content

Commit eb3671e

Browse files
authored
Feature: Serverless Endpoint (#193)
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.
1 parent 05ab27e commit eb3671e

17 files changed

+426
-69
lines changed
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2023-01-04T22:46:39Z"
3-
build_hash: 12246c7da82841b351ec7a9e1f139f9338f2784b
2+
build_date: "2023-01-19T03:37:00Z"
3+
build_hash: 1b20baf45a0b73a11b296050322a384c705fa897
44
go_version: go1.17.13
5-
version: v0.21.0
6-
api_directory_checksum: 19b63f2ee6b7e14b2f6d254a6caff0b9867539e5
5+
version: v0.22.0
6+
api_directory_checksum: c38df824c3c6e41cd4eaa559dccc4c05c7e8d075
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.117
99
generator_config_info:
10-
file_checksum: fd845048bf7dc84ecd3ea1ed1784b831d8f42645
10+
file_checksum: e3688a5487a10dccd7a5e488de025d9489043f7d
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ resources:
5757
Tags:
5858
compare:
5959
is_ignored: true
60+
hooks:
61+
delta_pre_compare:
62+
code: customSetDefaults(a, b)
6063
Endpoint:
6164
reconcile:
6265
requeue_on_success_seconds: 30
@@ -1017,7 +1020,6 @@ ignore:
10171020
shape_names:
10181021
# RSessionAppSettings is an empty struct that causes generation errors
10191022
- RSessionAppSettings
1020-
- ProductionVariantServerlessConfig
10211023
- ExecutionRoleIdentityConfig
10221024
- HyperParameterTuningResourceConfig
10231025
- InstanceMetadataServiceConfiguration

apis/v1alpha1/types.go

+34-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

+50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/sagemaker.services.k8s.aws_endpointconfigs.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ spec:
167167
type: integer
168168
modelName:
169169
type: string
170+
serverlessConfig:
171+
description: Specifies the serverless configuration for an endpoint
172+
variant.
173+
properties:
174+
maxConcurrency:
175+
format: int64
176+
type: integer
177+
memorySizeInMB:
178+
format: int64
179+
type: integer
180+
type: object
170181
variantName:
171182
type: string
172183
volumeSizeInGB:

config/crd/bases/sagemaker.services.k8s.aws_endpoints.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,17 @@ spec:
268268
currentInstanceCount:
269269
format: int64
270270
type: integer
271+
currentServerlessConfig:
272+
description: Specifies the serverless configuration for
273+
an endpoint variant.
274+
properties:
275+
maxConcurrency:
276+
format: int64
277+
type: integer
278+
memorySizeInMB:
279+
format: int64
280+
type: integer
281+
type: object
271282
currentWeight:
272283
type: number
273284
deployedImages:
@@ -295,6 +306,17 @@ spec:
295306
desiredInstanceCount:
296307
format: int64
297308
type: integer
309+
desiredServerlessConfig:
310+
description: Specifies the serverless configuration for
311+
an endpoint variant.
312+
properties:
313+
maxConcurrency:
314+
format: int64
315+
type: integer
316+
memorySizeInMB:
317+
format: int64
318+
type: integer
319+
type: object
298320
desiredWeight:
299321
type: number
300322
instanceType:
@@ -332,6 +354,17 @@ spec:
332354
currentInstanceCount:
333355
format: int64
334356
type: integer
357+
currentServerlessConfig:
358+
description: Specifies the serverless configuration for an endpoint
359+
variant.
360+
properties:
361+
maxConcurrency:
362+
format: int64
363+
type: integer
364+
memorySizeInMB:
365+
format: int64
366+
type: integer
367+
type: object
335368
currentWeight:
336369
type: number
337370
deployedImages:
@@ -359,6 +392,17 @@ spec:
359392
desiredInstanceCount:
360393
format: int64
361394
type: integer
395+
desiredServerlessConfig:
396+
description: Specifies the serverless configuration for an endpoint
397+
variant.
398+
properties:
399+
maxConcurrency:
400+
format: int64
401+
type: integer
402+
memorySizeInMB:
403+
format: int64
404+
type: integer
405+
type: object
362406
desiredWeight:
363407
type: number
364408
variantName:

generator.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ resources:
5757
Tags:
5858
compare:
5959
is_ignored: true
60+
hooks:
61+
delta_pre_compare:
62+
code: customSetDefaults(a, b)
6063
Endpoint:
6164
reconcile:
6265
requeue_on_success_seconds: 30
@@ -1017,7 +1020,6 @@ ignore:
10171020
shape_names:
10181021
# RSessionAppSettings is an empty struct that causes generation errors
10191022
- RSessionAppSettings
1020-
- ProductionVariantServerlessConfig
10211023
- ExecutionRoleIdentityConfig
10221024
- HyperParameterTuningResourceConfig
10231025
- InstanceMetadataServiceConfiguration

helm/crds/sagemaker.services.k8s.aws_endpointconfigs.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ spec:
167167
type: integer
168168
modelName:
169169
type: string
170+
serverlessConfig:
171+
description: Specifies the serverless configuration for an endpoint
172+
variant.
173+
properties:
174+
maxConcurrency:
175+
format: int64
176+
type: integer
177+
memorySizeInMB:
178+
format: int64
179+
type: integer
180+
type: object
170181
variantName:
171182
type: string
172183
volumeSizeInGB:

0 commit comments

Comments
 (0)