Beispiel #1
0
def deploy(
        obj,
        s3_model_location,
        num_instances,
        ec2_type,
        aws_tags,
        iam_role_arn,
        external_id,
        endpoint_name
):
    """
    Command to deploy ML model(s) on SageMaker
    """
    logger.info(ASCII_LOGO)
    logger.info("Started deployment on SageMaker ...\n")

    try:
        endpoint_name = api_cloud.deploy(
            dir=_config().sagify_module_dir,
            s3_model_location=s3_model_location,
            num_instances=num_instances,
            ec2_type=ec2_type,
            docker_tag=obj['docker_tag'],
            aws_role=iam_role_arn,
            external_id=external_id,
            tags=aws_tags,
            endpoint_name=endpoint_name
        )

        logger.info("Model deployed to SageMaker successfully")
        logger.info("Endpoint name: {}".format(endpoint_name))
    except ValueError as e:
        logger.info("{}".format(e))
        sys.exit(-1)
Beispiel #2
0
def deploy(obj, dir, s3_model_location, model_name, num_instances, ec2_type,
           aws_tags, vpc_configs):
    """
    Command to deploy ML model(s) on SageMaker
    """
    logger.info(ASCII_LOGO)
    logger.info("Started deployment on SageMaker ...\n")

    try:
        endpoint_name = api_cloud.deploy(dir=dir,
                                         s3_model_location=s3_model_location,
                                         model_name=model_name,
                                         vpc_configs=vpc_configs,
                                         num_instances=num_instances,
                                         ec2_type=ec2_type,
                                         docker_tag=obj['docker_tag'],
                                         tags=aws_tags)

        logger.info("Model deployed to SageMaker successfully")
        logger.info("Endpoint name: {}".format(endpoint_name))
    except ValueError as e:
        logger.info("{}".format(e))
        sys.exit(-1)