Created
December 30, 2021 11:01
-
-
Save pyaf/57a144de84eb6e590ba6d7fb5519e92c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build an image that can do training and inference in SageMaker | |
# This is a Python 3 image that uses the nginx, gunicorn, flask stack | |
# for serving inferences in a stable way. | |
FROM ubuntu:18.04 | |
MAINTAINER Amazon AI <[email protected]> | |
RUN apt-get -y update && apt-get install -y --no-install-recommends \ | |
wget \ | |
python3-pip \ | |
python3-setuptools \ | |
nginx \ | |
ca-certificates \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN ln -s /usr/bin/python3 /usr/bin/python | |
RUN ln -s /usr/bin/pip3 /usr/bin/pip | |
# Here we get all python packages. | |
# There's substantial overlap between scipy and numpy that we eliminate by | |
# linking them together. Likewise, pip leaves the install caches populated which uses | |
# a significant amount of space. These optimizations save a fair amount of space in the | |
# image, which reduces start up time. | |
RUN pip --no-cache-dir install numpy==1.16.2 scipy==1.2.1 scikit-learn==0.20.2 pandas flask gunicorn | |
# custom requirements | |
RUN pip install kneed | |
# Set some environment variables. PYTHONUNBUFFERED keeps Python from buffering our standard | |
# output stream, which means that logs can be delivered to the user quickly. PYTHONDONTWRITEBYTECODE | |
# keeps Python from writing the .pyc files which are unnecessary in this case. We also update | |
# PATH so that the train and serve programs are found when the container is invoked. | |
ENV PYTHONUNBUFFERED=TRUE | |
ENV PYTHONDONTWRITEBYTECODE=TRUE | |
ENV PATH="/opt/program:${PATH}" | |
# Set up the program in the image | |
COPY decision_trees /opt/program | |
WORKDIR /opt/program | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment