Skip to content

Commit

Permalink
added autogluon v0.0.14 support, changed the build method (#1640)
Browse files Browse the repository at this point in the history
* added autogluon v0.0.14 support, changed the build method

* changed the bash execution

Co-authored-by: Eric Johnson <[email protected]>
  • Loading branch information
yoheigon and metrizable authored Nov 10, 2020
1 parent 633fcf1 commit 84d8d37
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,32 +94,7 @@
"Collapsed": "false"
},
"source": [
"First, build autogluon package to copy into docker image."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"Collapsed": "false"
},
"outputs": [],
"source": [
"if not os.path.exists('package'):\n",
" !pip install PrettyTable -t package\n",
" !pip install --upgrade boto3 -t package\n",
" !pip install bokeh -t package\n",
" !pip install --upgrade matplotlib -t package\n",
" !pip install autogluon -t package"
]
},
{
"cell_type": "markdown",
"metadata": {
"Collapsed": "false"
},
"source": [
"Now build the training/inference image and push to ECR"
"Build the training/inference image and push to ECR"
]
},
{
Expand All @@ -142,8 +117,8 @@
},
"outputs": [],
"source": [
"!./container-training/build_push_training.sh {account} {region} {training_algorithm_name} {ecr_uri_prefix} {registry_id} {registry_uri}\n",
"!./container-inference/build_push_inference.sh {account} {region} {inference_algorithm_name} {ecr_uri_prefix} {registry_id} {registry_uri}"
"!/bin/bash ./container-training/build_push_training.sh {account} {region} {training_algorithm_name} {ecr_uri_prefix} {registry_id} {registry_uri}\n",
"!/bin/bash ./container-inference/build_push_inference.sh {account} {region} {inference_algorithm_name} {ecr_uri_prefix} {registry_id} {registry_uri}"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ARG REGISTRY_URI
FROM ${REGISTRY_URI}/mxnet-inference:1.6.0-cpu-py3

RUN pip install --upgrade pip

COPY package/ /opt/ml/code/package/
RUN pip install autogluon
RUN pip install PrettyTable

# Defines inference.py as script entrypoint
ENV SAGEMAKER_PROGRAM inference.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ARG REGISTRY_URI
FROM ${REGISTRY_URI}/mxnet-training:1.6.0-cpu-py3

RUN pip install --upgrade pip
RUN pip install autogluon
RUN pip install PrettyTable
ENV PATH="/opt/ml/code:${PATH}"

# Copies the training code inside the container
COPY package/ /opt/ml/code/package/
COPY container-training/train.py /opt/ml/code/train.py
COPY container-training/inference.py /opt/ml/code/inference.py

# this environment variable is used by the SageMaker PyTorch container to determine our user code directory.
ENV SAGEMAKER_SUBMIT_DIRECTORY /opt/ml/code

# Defines train.py as script entrypoint
ENV SAGEMAKER_PROGRAM train.py
ENV SAGEMAKER_PROGRAM train.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

warnings.filterwarnings('ignore', category=FutureWarning)

sys.path.append(os.path.join(os.path.dirname(__file__), '/opt/ml/code/package'))

import numpy as np
import pandas as pd
import pickle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from collections import Counter
from timeit import default_timer as timer

sys.path.insert(0, 'package')
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
from prettytable import PrettyTable
Expand Down

0 comments on commit 84d8d37

Please sign in to comment.