Blog AI news Set Amazon Sagemaker projects with Terraform Cloud
AI news

Set Amazon Sagemaker projects with Terraform Cloud

Set Amazon Sagemaker projects with Terraform Cloud

Amazon Sagemaker projects empower data scientists to serve the Amazon Internet Self-Services (AWS) tools and infrastructure to organize all entities of the Machinery Learning Life Cycle (ML), and to enable organizations to standardize and limit the resources available to their pre-science science teams.

For AWS customers using terraform to determine and manage their SI-Kod (IAC) infrastructure, the best current practice to enable Amazon Sagemaker projects carries a dependence on AWS Cloudformation to facilitate integration between AWS and terraorm catalog. This blocks enterprise clients, whose governance prohibits the use of the seller’s specific IAC, such as the cloudformation from the use of Terraform Cloud.

This post describes how you can activate Sagemaker projects with Terraform Cloud, removing the dependence of cloudformation.

AWS Catalog Catalog for Terraform Cloud

Sagemaker projects are directly designed on AWS catalog products. To avoid the use of cloudformation, these products should be defined as terraform products using AWS Catalog Catalog (SCE) for Terraform Cloud. This module, actively maintained by Hashicorp, contains a common AWS infrastructure for integrating the Clooud Terraform service catalog so that your service catalog products are set using Terraform Cloud platform.

By following the steps in this post, you can use the service catalog engine to set up sagemaker projects directly from Terraform Cloud.

PRECONDITIONS

To successfully set the example, you must have the following:

  1. An AWS account with permits needed to create and manage Sagemaker projects and service catalog products. View the service catalog documentation for more information on the service catalog permits.
  2. An existing domain of the Amazon Sagemaker studio with an Amazon Sagemaker’s accompanying user profile. Domain Studio Sagemaker MUST You have activated Sagemaker projects. See use the quick configuration for that Amazon Sagemaker.
  3. A UNIX terminal with the AWS (AWS CLI) command line interface and installed terraorm. Look at the installation or update in the latest version of AWS CLIAND TERRAFORT Install for more information about the installation.
  4. An existing Terraform Cloud account with the permits needed to create and manage jobs. See the following lessons to create your account quickly:
    1. HCP Terraform – Intro and Sign Up
    2. Log in to HCP Terraform by CLI

Check out the documentation of terraform teams and organizations for more information about Terraform Cloud permits.

Setting steps

  1. Clon sagemaker-custom-project-templates Warehouse from AWS GitHub samples in your local car, update the submodules and navigate to mlops-terraform-cloud Director.
    $ git clone https://github.com/aws-samples/sagemaker-custom-project-templates.git
    $ cd sagemaker-custom-project_templates
    $ git submodule update --init --recursive
    $ cd mlops-terraform-cloud

The previous base of the above code creates a portfolio of the service catalog, adds to the Sagemaker project model as a product catalog product, allows the role of the Sagemaker studio to enter the product catalog product, and adds the labels needed to make the product visible in the Sagemaker Studio. See create custom project templates in Sagemaker project documentation for more information about this process.

  1. Log in to your Terraform Cloud account

This makes your browser sign up to your HCP account and generates a security sign. Copy this security sign and paste it back to your terminal.

  1. Navigate on your AWS account and get the user role of user Sagemaker user Amazon resource (RNA) name for Sagemaker user profile associated with your Sagemaker studio domain. This role is used to grant Sagemaker studio users to create and manage Sagemaker projects.
    • On the AWS management keyboard for Amazon Sagemaker, select Fields by the navigation panel
      Amazon Sagemaker in the inner screen that highlights the workflow options for machine learning and quick startup configurations for users and organizations
    • Choose your studio domain
    • below User profilesChoose your user profile
    • IN User detailsCopy RNA
  2. Create a tfvars File with the variables needed for the work space at Terraform Cloud
    $ cp terraform.tfvars.example terraform.tfvars
  3. Put the right values ​​in newly created tfvars File Required the following variables:
    tfc_organization = "my-tfc-organization"
    tfc_team = "aws-service-catalog"
    token_rotation_interval_in_days = 30
    sagemaker_user_role_arns = ("arn:aws:iam::XXXXXXXXXXX:role/service-role/AmazonSageMaker-ExecutionRole")

Make sure your desired terraform cloud (TFC) organization has the right rights and that your tfc_team It’s unique for this setting. Look at the summary of terraform organizations for more information on the creation of organizations.

  1. Initialize Terraform Cloud workspace
  2. Apply Cloud Terraform’s work space
  3. Return back to the Sagemaker keyboard using the user profile associated with the role of the Sagemaker RNA user you previously copied and select Open studio CALL
  4. In the navigation panel, select SETTLING and then choose projects
  5. yoke Create the projectSelect mlops-tf-cloud-example product and then choose Other
  6. within Project detailsWrite a unique name for the template and (option) set a project description. yoke brew
  7. In a separate tab or window, return to your Terraform Cloud account workplace and you will see a work space that is being provided directly from the placement of your sagemaker project. The convention of naming the workspace will be

Personalization

This example can be modified to include custom terraform in your Sagemaker project model. To do this, determine your terraform at the MLOPS-Product/Products Directorate. When you are ready to settle, be sure to archive and compress this terraform using the following command:

$ cd mlops-product
$ tar -czf product.tar.gz product

cleaning

To remove the resources set with this example, execute below by the Project Directorate:

cONcluSiON

In this post you set out, decided and secured a custom template of the Sagemaker project simply in terraorm. Without dependent on other IAC tools, you can now activate the sagemaker projects strictly within your Terraform enterprise infrastructure.


Around the author

Max copeland It is a machinery learning engineer for AWS, the main customer engagements that include ML-ops, data science, data engineering and generating engineering.

Exit mobile version