{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Deployment flow\n",
"
\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pipeline Config\n",
"Your pipelines are configured by two files, shoot-config.json and layout-config.json. You can edit things like hyperparamters, deployment environmental variables, and instance types. The following describes the properties you change/should change. \n",
"\n",
"|Parameter Name| Description | Suggested Value|\n",
"|---|---|---|\n",
"|frameworkversion|frame work version|\"1.3.0\"|\n",
"|inputmode|\"File\" or \"Pipe\" depending on what input mode you want|\"File\"|\n",
"|hyperparameters|key value hyperparameters to send to your training job|{}|\n",
"|channels|the data channels for the instance, the suggested value will create a training data channel pointing to data with the 'data/train' prefix in the data bucket|{\"train\":{\"path\":\"data/train\"}}|\n",
"|trainvolumesize|how much EBS storage to attach to the training instances|\"5\"|\n",
"|traininstancecount|how many instances you want to use for training|1|\n",
"|hostinstancetype|inference instance type|\"ml.t2.medium\"|\n",
"|traininstancetype|training instance type|\"ml.m5.large\"|\n",
"\n",
"For details on possible parameters and values, see the [aws-sagemaker-build documentation](https://github.com/aws-samples/aws-sagemaker-build#Parameters). When you run the `startPipeline.js` script, this config files will be merged into the SSM parameter store that configures the pipelines."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test Deployed Endpoint\n",
"To test the endpoint (your deployed model) run :\n",
"- (optionaly) edit /bin/testLayout.py or /bin/testShoot.py to configure/customize your test\n",
"- run \n",
"```shell\n",
"/bin/testLayout.py # test for Defensive team\n",
"/bin/testShoot.py # test for Offensive team\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pushing your changes\n",
"Once you have made your changes and are ready to deploy them to production, follow these steps\n",
"1. Run the following command to stage files you change to be commited\n",
"```shell\n",
"git add \n",
"```\n",
"1. Commit your changes with a message\n",
"```shell\n",
"git commit -m \"\"\n",
"```\n",
"1. Push your changes to the remote repository\n",
"```shell\n",
"git push origin shoot #for offense\n",
"git push origin layout # for defense\n",
"```\n",
"1. Inform your Operations that there are changes to deploy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Data\n",
"All games are recorded and available in the game archive bucket. You will not be able to access the S3 data bucket until the Operations group has registered your team. \n",
"\n",
"### Download\n",
"The following script will download all the data from the S3 bucket (set in the config.js), unzip it, and merge it into a single file at /data/data.json\n",
"```shell\n",
"./bin/download_data.sh\n",
"```\n",
"\n",
"### Format:\n",
"The /data/data.json file is a new line deliminated JSON file with the following format\n",
"```json\n",
"{ \n",
" \"Status\":\"Finished\",\n",
" \"winner\":\"B\",\n",
" \"start_time\":\"\",\n",
" \"end_time\":\"\",\n",
"\t\"GameId\":\"d0d73e64-bd47-4bb2-ab50-ed0bd1935066\",\n",
" \"TeamA\":{\n",
" \"layout\":[[0,0 ...],...],\n",
" \"score\":0,\n",
" \"session\":{},\n",
" \"name\":\"purple people eaters\",\n",
"\t\t\"shots\":[{\"x\":6,\"y\":1},....]\n",
" },\n",
" \"TeamB\":{\n",
" \"layout\":[[0,0 ...],...],\n",
" \"score\":0,\n",
" \"session\":{},\n",
" \"name\":\"the dr strange loves\",\n",
"\t\t\"shots\":[{\"x\":1,\"y\":4},....]\n",
"\t }\n",
"}\n",
"```\n",
"|top level field|Description|\n",
"|---|---|\n",
"|Status| Finished or Failed depending on the status of the game|\n",
"|winner| the team name of the winner|\n",
"|start_time| when the game started|\n",
"|end_time| when the game finished|\n",
"|GameId| a unique ID for the game. Can be used with the replay web page to view a specific game|\n",
"\n",
"|Team* Field|Description|\n",
"|---|---|\n",
"|layout|the layout of ships for this game|\n",
"|score| how many ship squares were hit by this team|\n",
"|session| the last session state for this game for this team|\n",
"|shots| an ordered list of shots for this game. shots[0] is the first shot, shots[1] is the second etc.|\n",
"|name| the team name for this team|\n",
"\n",
"### Upload training data\n",
"After you have done any transformation to the data, you will need to upload the data to the appropriate data bucket by running the following\n",
"```shell\n",
"./bin/upload_data.sh\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!/home/ec2-user/SageMaker/GameDayRepo/bin/upload_data.sh"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Push and Commit\n",
"When you have finished, commit the changes to your git branch. Then, tell the Operations team to merge in your changes and deploy your code. \n",
"\n",
"```shell\n",
"git commit -a -m \"I am adding these features \"\n",
"git push -u origin $(git branch-name)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "conda_mxnet_p36",
"language": "python",
"name": "conda_mxnet_p36"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}