Skip to content

Commit

Permalink
added autogluon v0.0.14 support, changed the build method
Browse files Browse the repository at this point in the history
  • Loading branch information
yoheigon committed Oct 22, 2020
1 parent 4764539 commit da97c4b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 35 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 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 da97c4b

Please sign in to comment.