Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

A project template for developing BYOD docker images for use in Amazon SageMaker.

License

Notifications You must be signed in to change notification settings

aws-samples/amazon-sagemaker-BYOD-template

SageMaker BYOD template and tutorial

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.

Prerequisites

This repository has been tested in the following environments. - linux/Mac machine (local machine or on AWS) - AWS Cloud9 instance. - SageMaker Jupyter notebook

Setting up your own environment

Using Cloud9

  • 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

Using SageMaker notebook

  1. If you don't already have a SageMaker Jupyter notebook, launch one and open up JupyterLab
  2. Under the Git menu select Open Terminal
  3. In the terminal run
bash
  1. In the terminal run
cd SageMaker
  1. follow the rest of the Set up instructions below

Setup

  • 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

Tutorial

see the tutorial for an end to end tutorial on developing your custom SageMaker containers!

Mock File System

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.

Local Development

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.

Training Container

see here for details.

Serving Container

see here for details.

Deployment

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

SageMaker build

for more details of the SageMaker build project see the github project here

About

A project template for developing BYOD docker images for use in Amazon SageMaker.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages