Amazon SageMaker is a powerful tool for training machine learning models and scale and reliable deploying them. With Docker containers you make your own SageMaker Algorithms or migrate your existing models. This repository explains how to build, develop, and deploy these containers.
This repository has been tested in the following environments. - linux/Mac machine (local machine or on AWS) - AWS Cloud9 instance. - SageMaker Jupyter notebook
- Run Linux. (tested on Amazon Linux)
- Install npm >5 and node >8. (instructions)
- Install Docker. (instructions]
- Set up an AWS account. (instructions)
- Configure AWS CLI and a local credentials file. (instructions)
- If you dont already have a Cloud9 instance launch one. instructions
- see here for a tour of the Cloud9 IDE.
- run this command to update the node version on your cloud9 instance:
nvm install 8.9.4
nvm alias default 8.9.4
- If you don't already have a SageMaker Jupyter notebook, launch one and open up JupyterLab
- Under the Git menu select Open Terminal
- In the terminal run
bash
- In the terminal run
cd SageMaker
- follow the rest of the Set up instructions below
- clone this repository
git clone https://github.com/aws-samples/amazon-sagemaker-BYOD-template.git
- go into the directory
cd amazon-sagemaker-BYOD-template
- install dependencies
npm install
- copy config
cp config.js.example config.js
- edit config.js
param | description |
---|---|
region | the AWS region to launch stacks in |
profile | the AWS credential profile to use |
assetBucket | The name of an S3 bucket to store artifacts, If you do not have a bucket create on and enter its name here. Create a bucket here and select Create Bucket |
assetPrefix | The prefix to use when storing artifacts in the assetBucket |
params | do not edit this field |
see the tutorial for an end to end tutorial on developing your custom SageMaker containers!
The mock directory contains files and folders to mock the SageMaker environment that containers run it. These directories are used to local run and test your containers. See here for instructions on how to configure for you use case.
The containers directory provides the code to start development of SageMaker containers along with code to run and test locally using the mock file system.
see here for details.
see here for details.
You can use the aws-sagemaker-build project to deploy and test your code in sagemaker. Run the following to launch the sagebuild cloudformation stack configured to run your containers, copying information from the mock file system:
npm run up
You start a build/deployment of you algorithm by running
npm run upload && ./bin/start.js
You can update your stack by running:
npm run update
And you can delete your stack by running:
npm run down
for more details of the SageMaker build project see the github project here