Create Custom Project Templates
Important
As of October 28, 2024, the AWS CodeCommit templates have been removed. For new projects, select from the available project templates that use third-party Git repositories. For more information, see MLOps Project Templates.
If the SageMaker AI-provided templates do not meet your needs (for example, you want to have more complex orchestration in the CodePipeline with multiple stages or custom approval steps), create your own templates.
We recommend starting by using SageMaker AI-provided templates to understand how to organize your
code and resources and build on top of it. To do this, after you enable administrator access
to the SageMaker AI templates, log in to the https://console.aws.amazon.com/servicecatalog/
Create your own project templates to customize your MLOps project. SageMaker AI project templates are Service Catalog–provisioned products to provision the resources for your MLOps project.
To create a custom project template, complete the following steps.
-
Create a portfolio. For information, see Step 3: Create an Service Catalog Portfolio.
-
Create a product. A product is a CloudFormation template. You can create multiple versions of the product. For information, see Step 4: Create an Service Catalog Product.
For the product to work with SageMaker Projects, add the following parameters to your product template.
SageMakerProjectName: Type: String Description: Name of the project SageMakerProjectId: Type: String Description: Service generated Id of the project.
Important
We recommend that you wrap the CodeCommit repository into the SageMaker AI code repository for the project's repositories to be visible in VPC mode. The sample template and required addition are shown in the following code samples.
Original (sample) template:
ModelBuildCodeCommitRepository: Type: AWS::CodeCommit::Repository Properties: # Max allowed length: 100 chars RepositoryName: !Sub sagemaker-${SageMakerProjectName}-${SageMakerProjectId}-modelbuild # max: 10+33+15+10=68 RepositoryDescription: !Sub SageMaker Model building workflow infrastructure as code for the Project ${SageMakerProjectName} Code: S3: Bucket:
SEEDCODE_BUCKETNAME
Key: toolchain/model-building-workflow-v1.0.zip BranchName: mainAdditional content to add in VPC mode:
SageMakerRepository: Type: AWS::SageMaker::CodeRepository Properties: GitConfig: RepositoryUrl: !GetAtt ModelBuildCodeCommitRepository.CloneUrlHttp Branch: main
-
Add a launch constraint. A launch constraint designates an IAM role that Service Catalog assumes when a user launches a product. For information, see Step 6: Add a Launch Constraint to Assign an IAM Role.
-
Provision the product on https://console.aws.amazon.com/servicecatalog/
to test the template. If you are satisfied with your template, continue to the next step to make the template available in Studio (or Studio Classic). -
Grant access to the Service Catalog portfolio that you created in step 1 to your Studio (or Studio Classic) execution role. Use either the domain execution role or a user role that has Studio (or Studio Classic) access. For information about adding a role to the portfolio, see Step 7: Grant End Users Access to the Portfolio.
-
To make your project template available in your Organization templates list in Studio (or Studio Classic), create a tag with the following key and value to the Service Catalog product you created in step 2.
-
key:
sagemaker:studio-visibility
-
value:
true
-
After you complete these steps, Studio (or Studio Classic) users in your organization can create a project with the template you created by following the steps in Create a MLOps Project using Amazon SageMaker Studio or Studio Classic and choosing Organization templates when you choose a template.