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
| #!/usr/bin/env bash | |
| MODEL_NAME=<<name your model>> | |
| ROLE_NAME=AmazonSageMaker-ExecutionRole-XXXXXXXXXXXXXXXX | |
| # the name of the image created with | |
| ECS_IMAGE_NAME=<<your image name>> | |
| # the role arn of the role | |
| EXECUTION_ROLE_ARN=$(aws iam get-role --role-name ${ROLE_NAME} | jq -r .Role.Arn) |
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
| # Using the official tensorflow serving image from docker hub as base image | |
| FROM tensorflow/serving | |
| # Installing NGINX, used to rever proxy the predictions from SageMaker to TF Serving | |
| RUN apt-get update && apt-get install -y --no-install-recommends nginx git | |
| # Copy our model folder to the container | |
| COPY <<local model directory>> /<<model directory inside Docker image>> | |
| # Copy NGINX configuration to the container |
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
| events { | |
| # determines how many requests can simultaneously be served | |
| worker_connections 2048; | |
| } | |
| http { | |
| server { | |
| # Increase JSON POST payload to bypass 413 Client Error: Request Entity Too Large for URL | |
| client_max_body_size 100M; |
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
| #!/usr/bin/env bash | |
| IMAGE_NAME={name your local Docker image here} | |
| REGION=$(aws configure get region) | |
| ACCOUNT=$(aws sts get-caller-identity --query Account --output text) | |
| # If the ECS repository doesn't exist, creates it. | |
| aws ecr create-repository --repository-name ${IMAGE_NAME} > /dev/null 2>&1 |
NewerOlder