Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better layering of docker image #343

Closed
ThomasDelteil opened this issue Mar 9, 2018 · 2 comments
Closed

Better layering of docker image #343

ThomasDelteil opened this issue Mar 9, 2018 · 2 comments
Assignees

Comments

@ThomasDelteil
Copy link
Contributor

ThomasDelteil commented Mar 9, 2018

Currently the Dockerfile use a single layer to do an awful lot of things, which means any changes on this line

RUN apt-get update && \
    apt-get install -y software-properties-common && \
    add-apt-repository -y ppa:certbot/certbot && \
    apt-get update && \
    apt-get install -y \
    build-essential \
    libatlas-base-dev \
    libopencv-dev \
    graphviz \
    python-dev \
    openjdk-8-jdk \
    nginx \
    protobuf-compiler \
    libprotoc-dev \
    python-certbot-nginx \
    curl \
    vim \
    && rm -rf /var/lib/apt/lists/* \
    && cd /tmp \
    && curl -O https://bootstrap.pypa.io/get-pip.py \
    && python get-pip.py \
    && pip install gevent gunicorn mxnet-model-server \
    && pip uninstall --yes mxnet \
    && pip install mxnet-mkl \
    && mkdir /mxnet_model_server

triggers the creation of a new heavy layer. I would suggest separating the dependencies that are not likely to change and make it a base image.
Then you can have a different image for cpu/gpu that mostly only installs the right version of mxnet and mxnet-model-server. This makes the updates to the awsdeeplearningteam/mms_cpu much faster. I am writing this while waiting for the updates to the latest version that I hope might fix the bug I reported earlier:

Step 1/4 : FROM awsdeeplearningteam/mms_cpu:latest
latest: Pulling from awsdeeplearningteam/mms_cpu
22dc81ace0ea: Already exists
1a8b3c87dba3: Already exists
91390a1c435a: Already exists
07844b14977e: Already exists
b78396653dae: Already exists
8f4e3302427d: Downloading [========================================>          ]  515.4MB/639.9MB
8f4e3302427d: Downloading [=========================================>         ]  532.1MB/639.9MB

Actually I am going to issue a PR

edit: holding off on the PR, since I have seen the Dockerfile is different here and pin-pointing the mxnet-model-server version: https://hub.docker.com/r/awsdeeplearningteam/mms_cpu/~/dockerfile/

@vdantu
Copy link
Contributor

vdantu commented Mar 9, 2018

Reg the layering, thats a good point. We will break this up further.

@vrakesh
Copy link
Contributor

vrakesh commented Apr 24, 2018

Added in pull request #363

@vrakesh vrakesh closed this as completed Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants