Get Started
The SageMaker AI template enables self service user profile creation within AWS Sagemaker AI with admin defined cost saving controls. In this guide, we will be using Rafay's curated template for AWS SageMaker AI available from the Template Catalog. The Org Admin for the user's Rafay Org has the privileges to share the system templates from Rafay's Catalog to specific/all projects.
End Users (typically data scientists) will
- Service profiles are based on environment templates powered by Rafay's Environment Manager.
Note that administrators can also create and configure Custom environment templates for use cases outside the list supported out of the box in Rafay's Template Catalog.
Info
Please check Rafay's Public Roadmap or contact support for details on additional templates for the Template Catalog.
Configure Template¶
When the template is executed by the Rafay agent operating behind the firewall, it will receive the configured template, the associated Infra as Code (IaC), credentials and policies from the Rafay Platform. It will then execute this code on the behalf of the user.
1. Specify Agent¶
Let's configure the template to be received and executed by the Rafay Agent we created in a prior step.
- Under the "Agents" tab, click on "Add Agent"
- Select the name of the agent you configured in the prior step
- Ensure that the override configuration is specified to "Not Allowed" because we do not want the downstream users to be able to change this
- Save your changes
2. Config Context¶
The config context will typically encapsulate credentials and environment variables required for the agent to perform its job. In this case, we will configure the Rafay Agent with credentials so that it can make programmatic (API) calls to AWS.
- Under the "Config Contexts" tab in the environment template, edit "aws"
- Expand "Environment Variables" and you should see three entries: AWS_DEFAULT_REGION, AWS_SECRET_ACCESS_KEY & AWS_ACCESS_KEY_ID
- Click on Edit for each entry and provide the proper value for your environment
- Select Override to "Not Allowed" to ensure none of the downstream users have visibility or access to the config context
- Click Save
- Click Save as Draft
Configure PaaS¶
Next, we will configure a custom PaaS service profile to allow self service users to deploy the template.
- Navigate to PaaS Studio
- Select "Service Profiles"
- Select the project where the template was previously created
- Click "New Service Profile"
- Enter a name for the profile
- Select the previously created template and version
- Select "Custom" for the service type
- Select "Yes" for "Will compute be auto-created"
- Click Save & Continue
On the following screen, navigate to "Input Settings" - Deselect "Allow Override For All" and then click "Deselect All". This will prevent the user from changing these settings. - Update the following input variable values
Name | Value |
---|---|
domain_id | SageMaker Domain ID |
execution_role_arn | Role ARN for the User Profile |
hidden_instance_types | The instance types to hide from the user |
idle_timeout_in_minutes | The number of idle minutes before suspending the instance |
region | The AWS region where SageMaker is being used |
- Navigate to "Output Settings"
- Click "Add Output"
- Enter the name "user_url"
- Enter the label "URL For SageMaker AI"
- Click Save Changes
Deploy¶
Next, we will use developer hub to deploy an instance of the service profile.
- Navigate to Developer Hub
- Select the project where the template was previously created
- Click "Workspaces"
- Click "New Workspace"
- Enter a name for the workspace
- Click Save
- Click "Custom Services"
- Click "New Custom Service"
- Click "Select" on the SageMaker service card
- Enter a name for the instance
- Click Deploy
After a short period of time, the instance will be deployed.
Utilize¶
Next, we will use use the newly deployed profile.
- Click the URL For SageMaker AI
- Login to the AWS Console
- Click "Launch -> Studio"
You will now be within the AWS SageMaker User Profile.