-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoint-config-template.yml
74 lines (70 loc) · 2.37 KB
/
endpoint-config-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Description:
This template is built and deployed by the infrastructure pipeline in various stages (staging/production) as required.
It specifies the resources that need to be created, like the SageMaker Endpoint. It can be extended to include resources like
AutoScalingPolicy, API Gateway, etc,. as required.
Parameters:
SageMakerProjectName:
Type: String
Description: Name of the project
MinLength: 1
MaxLength: 32
AllowedPattern: ^[a-zA-Z](-*[a-zA-Z0-9])*
ModelExecutionRoleArn:
Type: String
Description: Execution role used for deploying the model.
ModelPackageName:
Type: String
Description: The trained Model Package Name
StageName:
Type: String
Description:
The name for a project pipeline stage, such as Staging or Prod, for
which resources are provisioned and deployed.
EndpointInstanceCount:
Type: Number
Description: Number of instances to launch for the endpoint.
MinValue: 1
EndpointInstanceType:
Type: String
Description: The ML compute instance type for the endpoint.
DataCaptureUploadPath:
Type: String
Description: The s3 path to which the captured data is uploaded.
SamplingPercentage:
Type: Number
Description: The sampling percentage
MinValue: 0
MaxValue: 100
EnableDataCapture:
Description: Enable Data capture.
Default: true
Type: String
AllowedValues: [true, false]
Resources:
Model:
Type: AWS::SageMaker::Model
Properties:
Containers:
- ModelPackageName: !Ref ModelPackageName
ExecutionRoleArn: !Ref ModelExecutionRoleArn
EndpointConfig:
Type: AWS::SageMaker::EndpointConfig
Properties:
ProductionVariants:
- InitialInstanceCount: !Ref EndpointInstanceCount
InitialVariantWeight: 1.0
InstanceType: !Ref EndpointInstanceType
ModelName: !GetAtt Model.ModelName
VariantName: AllTraffic
DataCaptureConfig:
EnableCapture: !Ref EnableDataCapture
InitialSamplingPercentage: !Ref SamplingPercentage
DestinationS3Uri: !Ref DataCaptureUploadPath
CaptureOptions:
- CaptureMode: Input
- CaptureMode: Output
Endpoint:
Type: AWS::SageMaker::Endpoint
Properties:
EndpointName: !Sub ${SageMakerProjectName}-${StageName}
EndpointConfigName: !GetAtt EndpointConfig.EndpointConfigName