Amazon SageMaker integration#

We offer a simple pipeline that allows you to run Fortuna on Amazon SageMaker with minimal effort.

  1. Create an AWS account - it is free! Store the account ID and the region where you want to launch training jobs.

  2. First, update your local AWS credentials. Then you need to build and push a Docker image to an Amazon ECR repository. This script will help you doing so - it will require your AWS account ID and region. If you need other packages to be included in your Docker image, you should consider customize the Dockerfile. NOTE: the script has been tested on a M1 MacOS. It is possible that different operating systems will need small modifications.

  3. Create an S3 bucket. You will need this to dump the results from your training jobs on Amazon Sagemaker.

  1. Write a configuration yaml file. This will include your AWS details, the path to the entrypoint script that you want to run on Amazon SageMaker, the arguments to pass to the script, the path to the S3 bucket where you want to dump the results, the metrics to monitor, and more. See here for an example.

  2. Finally, given config_dir, that is the absolute path to the main configuration directory, and config_filename, that is the name of the main configuration file (without .yaml extension), enter Python and run the following:

from fortuna.sagemaker import run_training_job
run_training_job(config_dir=config_dir, config_filename=config_filename)