Skip to content

Commit e9220f4

Browse files
authored
chore(construct): SageMaker JumpStart construct endpoint name update (#300)
* chore(construct): prepend string to endpoint name for sg jmpstrt * chore(construct): make endpoint name required
1 parent 5dd3d9a commit e9220f4

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

apidocs/interfaces/JumpStartSageMakerEndpointProps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ___
2626

2727
### endpointName
2828

29-
`Optional` `Readonly` **endpointName**: `string`
29+
`Readonly` **endpointName**: `string`
3030

3131
___
3232

src/patterns/gen-ai/aws-model-deployment-sagemaker/README_jumpstart.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Parameters
9898
| **Name** | **Type** | **Required** |**Description** |
9999
|:-------------|:----------------|-----------------|-----------------|
100100
| model | JumpStartModel | ![Required](https://img.shields.io/badge/required-ff0000) | The model to deploy |
101-
| endpointName | string| ![Optional](https://img.shields.io/badge/optional-4169E1) | Name of the SageMaker endpoint created by the construct |
101+
| endpointName | string| ![Required](https://img.shields.io/badge/required-ff0000) | Name of the SageMaker endpoint created by the construct. The construct will prepend 'jumpstart-' to the name of the endpoint. |
102102
| acceptEula | boolean| ![Optional](https://img.shields.io/badge/optional-4169E1) | Specifies agreement to the model end-user license agreement (EULA). The AcceptEula value must be explicitly defined as True in order to accept the EULA that the model requires. The user is responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for their use case before downloading or using a model. |
103103
| instanceType | SageMakerInstanceType | ![Optional](https://img.shields.io/badge/optional-4169E1) | The ML compute instance type. If not provided, the default instance type will be used. This value is available in the [models spec](./jumpstart-model.ts) |
104104
| instanceCount | Integer | ![Optional](https://img.shields.io/badge/optional-4169E1) | Number of instances to launch initially |

src/patterns/gen-ai/aws-model-deployment-sagemaker/jumpstart-sagemaker-endpoint.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { SageMakerInstanceType } from './sagemaker-instance-type';
2121

2222
export interface JumpStartSageMakerEndpointProps {
2323
readonly model: JumpStartModel;
24-
readonly endpointName?: string;
24+
readonly endpointName: string;
2525
readonly instanceType?: SageMakerInstanceType;
2626
readonly instanceCount?: number;
2727
readonly role?: iam.Role;
@@ -113,7 +113,7 @@ export class JumpStartSageMakerEndpoint extends SageMakerEndpointBase {
113113

114114
const endpoint = new sagemaker.CfnEndpoint(scope, `${this.spec.modelId}-endpoint-${id}`, {
115115
endpointConfigName: endpointConfig.getAtt('EndpointConfigName').toString(),
116-
endpointName: props.endpointName,
116+
endpointName: 'jumpstart-'+props.endpointName,
117117
});
118118

119119
endpoint.addDependency(endpointConfig);

test/patterns/gen-ai/aws-model-deployment-sagemaker/aws-model-deployment-sagemaker.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe('JumpStartSageMakerEndpoint construct', () => {
4141
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
4242
acceptEula: true,
4343
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
44+
endpointName: 'testendpoint',
4445
});
4546
JmpStrtTestTemplate = Template.fromStack(JmpStrtTestStack);
4647

@@ -115,6 +116,7 @@ describe('JumpStartSageMakerEndpoint eula validation', () => {
115116
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
116117
acceptEula: false, // should fail synth
117118
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
119+
endpointName: 'testendpoint',
118120
});
119121
};
120122

@@ -129,6 +131,7 @@ describe('JumpStartSageMakerEndpoint eula validation', () => {
129131
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
130132
acceptEula: true, // should succeed synth
131133
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
134+
endpointName: 'testendpoint',
132135
});
133136
};
134137

@@ -142,6 +145,7 @@ describe('JumpStartSageMakerEndpoint eula validation', () => {
142145
new JumpStartSageMakerEndpoint(JmpStrtTestStack, 'test3', {
143146
model: JumpStartModel.MODEL_DEPTH2IMG_STABLE_DIFFUSION_V1_5_CONTROLNET_1_0_0, // eula not defined
144147
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
148+
endpointName: 'testendpoint',
145149
});
146150
};
147151

@@ -200,6 +204,7 @@ describe('JumpStartSageMakerEndpoint VPC construct', () => {
200204
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
201205
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
202206
acceptEula: true,
207+
endpointName: 'testendpoint',
203208
vpcConfig: {
204209
securityGroupIds: securityGroups.map(s => s.securityGroupId),
205210
subnets: vpc.privateSubnets.map((subnet) => subnet.subnetId),

0 commit comments

Comments
 (0)