Skip to content

アプリケーション内で をクリックすると、お使いのDataRobotバージョンに関する全プラットフォームドキュメントにアクセスできます。

SageMakerでの自動デプロイと置換

本機能の提供について

SageMakerでのカスタムモデルとスコアリングコードの自動デプロイと置換は、デフォルトではオフになっています。 この機能を有効にする方法については、DataRobotの担当者または管理者にお問い合わせください。

機能フラグ:SageMakerでカスタムモデルの自動デプロイと置換を有効にする

DataRobotが管理するSageMaker予測環境を作成し、SageMakerでリアルタイム推論やサーバーレス推論を用いてカスタムモデルとスコアリングコードをデプロイします。 DataRobot管理を有効にすると、外部SageMakerデプロイは、自動モデル置換を含むMLOps管理にアクセスできるようになります。

SageMaker予測環境の作成

SageMakerにモデルをデプロイするには、まずカスタムSageMaker予測環境を作成します。

  1. コンソールで、予測環境+ 予測環境を追加の順にクリックします。

  2. 予測環境を追加ダイアログボックスで、予測環境設定を行います。

    • 予測環境の説明的な名前とオプションの説明を入力します。

    • Amazon Web Services(AWS)を、プラットフォームドロップダウンから選択します。

    • DataRobotが管理設定を有効にすると、この予測環境が管理エージェントを介して、DataRobotカスタムモデルとスコアリングコードモデルを自動的にパッケージ化してデプロイできます。

      AWS credentials required

      SageMakerでのスコアリングコードのDataRobot管理には、SageMakerへの既存のデータ接続が必要です。 既存のSageMakerデータ接続がない場合、データ接続が見つかりませんアラートが表示され、データ接続に移動して SageMaker接続を作成するよう指示されます。

  3. In the Management settings, select the related AWS Credentials and specify a Region. 指定されると、DataRobotは利用可能なロールを自動的に取得します。 Configure the following:

    • SageMaker IAM Role: 予測環境のSageMakerロールを設定します。 IAM実行ロールを設定するには、 SageMakerのドキュメントを参照してください。 実行ロールには、次のAmazon SQS権限が必要です。

      • "sqs:SendMessage"
      • "sqs:GetQueueUrl"
      • "sqs:GetQueueAttributes"
      • "sqs:ListQueues"
    • CodeBuild IAM Role: Configure the AWS CodeBuild service role required for CodeBuild to build model images. CodeBuildまたはAWS CodePipelineコンソールを使用して、CodeBuildサービスロールを作成します。これを行うには、 AWSのドキュメントを参照してください。 CodeBuildサービスロールには、次のAmazon SQS権限が必要です。

      • "ecr:ListImages"
      • "iam:GetRole"
      • "iam:PassRole"
      • "sts:AssumeRole"
    • ECRリポジトリECRリポジトリの作成については、AWSドキュメントを参照してください。

    • ECRキャッシュDocker HubのECRリポジトリキャッシュの作成については、AWSのドキュメントを参照してください。

    • S3 Bucket: Select the S3 Bucket.

    • Add AWS tags: (Optional) Add tags to help differentiate your AWS Workspace. Empty keys are not allowed and are removed when saved.

  4. (Optional) To connect to and retrieve data from Amazon SQS for monitoring, in the Monitoring settings section, click Enable monitoring and configure the AWS Credentials, Region, and SQS Queue fields. You can optionally define a Visibility timeout (in seconds) to set how long the message persists before it is deleted from the SQS queue.

    You can also click Environment variables and then + New environment variables to add environment variables to the prediction environment.

  5. 環境設定を行った後、環境を追加をクリックします。

    これで、予測環境ページからSagemaker環境を利用できるようになりました。

モデルをSagemaker予測環境にデプロイ

Sagemaker予測環境を作成したら、その環境にモデルをデプロイできます。

  1. On the Registry > Model directory page, in the table of registered models, click the registered model containing the version you want to deploy, opening the list of versions.

  2. From the list of versions, click the custom model or Scoring Code enabled version you want to deploy, opening the registered model version panel.

  3. In the upper-right corner of any tab in the registered model version panel, click Deploy.

  4. In the Prediction history and service health settings, under Choose prediction environment, click Change.

  5. In the Select prediction environment panel, click AWS Sagemaker, and then click the prediction environment you want to deploy to.

  6. With a Sagemaker environment selected, in the Prediction history and service health section, set the Real-time inference instance type and Initial instance count fields.

  7. (Optional) Open the Advanced environment settings and define additional Environment key-value pairs to provide extra parameters to the Sagemaker deployment interface.

  8. Configure the remaining deployment settings. 完了したら、モデルをデプロイをクリックします。

    モデルがSagemakerにデプロイされたら、予測 > ポータブル予測タブからデータをスコアリングコードスニペットを使用して、Sagemaker内でデータをスコアリングできます。

Sagemaker予測環境を再起動

予測環境で使用されるSagemakerデータ接続のデータベース設定または資格情報を更新する場合、環境を再起動して、環境にこれらの変更を適用できます。

  1. デプロイ > 予測環境ページをクリックして、リストからSagemaker予測環境を選択します。

  2. 予測環境設定の下にあるサービスアカウントで、環境を再起動をクリックします。


更新しました September 7, 2024