model_config_from_estimator: Export Airflow model config from a SageMaker estimator

View source: R/workflow_airflow.R

model_config_from_estimatorR Documentation

Export Airflow model config from a SageMaker estimator

Description

Export Airflow model config from a SageMaker estimator

Usage

model_config_from_estimator(
  estimator,
  task_id,
  task_type,
  instance_type = NULL,
  role = NULL,
  image_uri = NULL,
  name = NULL,
  model_server_workers = NULL,
  vpc_config_override = "VPC_CONFIG_DEFAULT"
)

Arguments

estimator

(sagemaker.model.EstimatorBase): The SageMaker estimator to export Airflow config from. It has to be an estimator associated with a training job.

task_id

(str): The task id of any airflow.contrib.operators.SageMakerTrainingOperator or airflow.contrib.operators.SageMakerTuningOperator that generates training jobs in the DAG. The model config is built based on the training job generated in this operator.

task_type

(str): Whether the task is from SageMakerTrainingOperator or SageMakerTuningOperator. Values can be 'training', 'tuning' or None (which means training job is not from any task).

instance_type

(str): The EC2 instance type to deploy this Model to. For example, 'ml.p2.xlarge'

role

(str): The “ExecutionRoleArn“ IAM Role ARN for the model

image_uri

(str): A Docker image URI to use for deploying the model

name

(str): Name of the model

model_server_workers

(int): The number of worker processes used by the inference server. If None, server will use one worker per vCPU. Only effective when estimator is a SageMaker framework.

vpc_config_override

(dict[str, list[str]]): Override for VpcConfig set on the model. Default: use subnets and security groups from this Estimator. * 'Subnets' (list[str]): List of subnet ids. * 'SecurityGroupIds' (list[str]): List of security group ids.

Value

dict: Model config that can be directly used by SageMakerModelOperator in Airflow. It can also be part of the config used by SageMakerEndpointOperator in Airflow.


DyfanJones/sagemaker-r-workflow documentation built on April 3, 2022, 11:28 p.m.