Skip to content
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

chore(construct): SageMaker JumpStart construct endpoint name update #300

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apidocs/interfaces/JumpStartSageMakerEndpointProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ___

### endpointName

• `Optional` `Readonly` **endpointName**: `string`
• `Readonly` **endpointName**: `string`

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Parameters
| **Name** | **Type** | **Required** |**Description** |
|:-------------|:----------------|-----------------|-----------------|
| model | JumpStartModel | ![Required](https://img.shields.io/badge/required-ff0000) | The model to deploy |
| endpointName | string| ![Optional](https://img.shields.io/badge/optional-4169E1) | Name of the SageMaker endpoint created by the construct |
| 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. |
| 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. |
| 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) |
| instanceCount | Integer | ![Optional](https://img.shields.io/badge/optional-4169E1) | Number of instances to launch initially |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { SageMakerInstanceType } from './sagemaker-instance-type';

export interface JumpStartSageMakerEndpointProps {
readonly model: JumpStartModel;
readonly endpointName?: string;
readonly endpointName: string;
readonly instanceType?: SageMakerInstanceType;
readonly instanceCount?: number;
readonly role?: iam.Role;
Expand Down Expand Up @@ -113,7 +113,7 @@ export class JumpStartSageMakerEndpoint extends SageMakerEndpointBase {

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

endpoint.addDependency(endpointConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('JumpStartSageMakerEndpoint construct', () => {
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
acceptEula: true,
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
endpointName: 'testendpoint',
});
JmpStrtTestTemplate = Template.fromStack(JmpStrtTestStack);

Expand Down Expand Up @@ -115,6 +116,7 @@ describe('JumpStartSageMakerEndpoint eula validation', () => {
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
acceptEula: false, // should fail synth
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
endpointName: 'testendpoint',
});
};

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

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

Expand Down Expand Up @@ -200,6 +204,7 @@ describe('JumpStartSageMakerEndpoint VPC construct', () => {
model: JumpStartModel.META_TEXTGENERATION_LLAMA_2_7B_F_2_0_2,
instanceType: SageMakerInstanceType.ML_G5_2XLARGE,
acceptEula: true,
endpointName: 'testendpoint',
vpcConfig: {
securityGroupIds: securityGroups.map(s => s.securityGroupId),
subnets: vpc.privateSubnets.map((subnet) => subnet.subnetId),
Expand Down
Loading