Skip to content

myoshioka/fastapi-async-sagemaker-app

Repository files navigation

fastapi-async-sagemaker-app

A sample application that calls the sagemaker endpoint asynchronously using FastAPI.

Creating a Samemaker endpoint

  • Build the container image with a dockerfile.
$ docker build -t sagemaker-endpoint-test -f ./Dockerfile.sagemaker .
  • Push a Docker image to an Amazon ECR repository.
$ docker push [aws_account_id].dkr.ecr.[region].amazonaws.com/sagemaker-endpoint-test
  • Create a samemaker endpoint by referring to this page.

Usage

## Copy the dotenv file
$ cp ./dotenv.sample ./.env

## configure the aws credentials
$ vi .env

## Start the container.
$ docker-compose up -d

## Launch the application
$ docker-compose exec app python main.py

## Execute the script for the test request
$ docker-compose exec app python request_test.py

About

A sample application that calls the sagemaker endpoint asynchronously using FastAPI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published