This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Call the estimator with the main parameters | |
from sagemaker.estimator import Estimator | |
estimator = Estimator( | |
image_uri=ecr_image, | |
role=role, | |
instance_count=1, | |
instance_type="ml.c4.xlarge", | |
output_path=out_path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sagemaker | |
import json | |
from sagemaker import get_execution_role | |
import boto3 | |
# Role to have access of reading and write inside S3 | |
role = get_execution_role() | |
# Path files | |
train_path='s3://topicmodeling/train/base_treino.csv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%sh | |
# Login in ECR | |
aws ecr get-login-password --region xxxxx | docker login --username AWS --password-stdin xxxxxx.dkr.ecr.xxxxx.amazonaws.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%writefile Dockerfile | |
FROM python:3.7-buster | |
# Set a docker label to advertise multi-model support on the container | |
LABEL com.amazonaws.sagemaker.capabilities.multi-models=false | |
# Set a docker label to enable container to use SAGEMAKER_BIND_TO_PORT environment variable if present | |
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true | |
RUN apt-get update -y && apt-get -y install --no-install-recommends default-jdk | |
RUN rm -rf /var/lib/apt/lists/* |