Additional Requirements in AWS Sagemaker for CI/CD
-
The model should be present in a
model group
and should have amodel package
. - An event bridge webhook is then required to relay the model package updates to Inferless.
-
The following steps will illustrate how we can create a
model group, model package ,create an event bridge and approve a model version
using the boto3 python library.
1. Create a model package group
-
To create a model group by using Boto3, call the
create_model_package_group
method and specify a name and description as parameters. -
The response from the
create_model_package_group
call is the Amazon Resource Name (ARN) of the new model package group. - The following example shows how to create a model package group.
2. Create a model package version
-
To register a model version by using Boto3, call the
create_model_package
method. -
First, you set up the parameter dictionary to pass to the
create_model_package
method. -
Then you call the
create_model_package
method, passing in the parameter dictionary that you just set up. - The following example shows the above steps mentioned:
**"Input Package URL"**
3. Create an AWS Event Bridge Rule and API destination.
- You need to set up an AWS Event Bridge to monitor the AWS events and send a webhook to Inferless whenever there is an update to the package.
- You can view the video below to understand how to create one.
4. Approving a model package version
-
Setting the status to
Approved
can initiate CI/CD deployment for the model. -
The following code snippet shows how to manually change the approval status to
Approved
.