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

Adding script to build Docker images with ETA installed #440

Merged
merged 14 commits into from
Mar 3, 2020
Merged

Conversation

brimoor
Copy link
Contributor

@brimoor brimoor commented Mar 3, 2020

This PR adds a script for building Docker images with ETA installed.

@brimoor brimoor added the feature Work on a feature request label Mar 3, 2020
@brimoor brimoor requested review from a team March 3, 2020 00:55
@brimoor brimoor self-assigned this Mar 3, 2020
Copy link

@ecrews ecrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

docker/README.md Outdated

- [Docker Community Edition](https://hub.docker.com/search/?type=edition&offering=community)
- To build/run GPU-enabled images, you must install `nvidia-docker` by
following [these instructions](https://github.com/NVIDIA/nvidia-docker)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 19.03, Docker natively supports NVIDIA GPUs, so nvidia-docker isn't necessary. See the --gpus option here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 issue made for this: #443

docker/README.md Outdated Show resolved Hide resolved
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get -y --no-install-recommends install \
sudo \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want reproducible environments, we want to pin dependency versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 issue made for this: #444

COPY eta/ eta/
ARG TENSORFLOW_VERSION
RUN pip --no-cache-dir install --upgrade pip setuptools \
&& pip --no-cache-dir install -r eta/requirements.txt \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's quite a lot going on here... we really want to package ETA and make it installable via pip.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but most of the extra work is non-Python related install, so there's a bit of work required to make this as clean as possible


# Build image
docker build \
--file Dockerfile \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to specify this, as it looks for Dockerfile by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

git submodule init
git submodule update
cp config-example.json config.json
rm -rf .git/modules # trim the fat (removes ~500MB)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're trying to keep .git/modules out of the build context, I'd create a .dockerignore and specify it there instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 done

docker/README.md Outdated
```shell
BASE_IMAGE="nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04"
TENSORFLOW_VERSION="tensorflow-gpu==1.12.0"
TAG="eta-gpu-ubuntu-16.04-cuda-9.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tagging here is a little confusing... all the information is in the repository name, and none of it in the image tag. Generally, images are versioned by tag, so you want something more like voxel51/eta:gpu-ubuntu-16.04-cuda-9.0. Also missing the ETA version, which I think would be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 done

&& ln -s /usr/bin/python3.6 /usr/local/bin/python \
&& curl https://bootstrap.pypa.io/get-pip.py | python

WORKDIR /dev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's your problem - /dev is a tmpfs: https://superuser.com/questions/675568/shrink-or-delete-udev-partition-in-ubuntu/675664#675664

Change the working directory something like /usr/src/app instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AHHHHHHH. Thanks for catching

TAG=$3

# Clone ETA
git clone https://github.com/voxel51/eta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is desirable - the usual pattern is that the Dockerfile is in the root of the project directory and you copy the code in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the rec- updated

@brimoor
Copy link
Contributor Author

brimoor commented Mar 3, 2020

@ecrews updated and now works. Take a look!

@brimoor brimoor requested a review from ecrews March 3, 2020 17:41
@ecrews
Copy link

ecrews commented Mar 3, 2020

Doing a second pass now!

Copy link

@ecrews ecrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It builds! Could use an overhaul, but I'll save that for another PR.

@brimoor
Copy link
Contributor Author

brimoor commented Mar 3, 2020

@ecrews thanks for your help! If there's anything else on your wishlist, it would be nice to track via Issues

@brimoor brimoor merged commit 46baa2a into develop Mar 3, 2020
@brimoor brimoor deleted the eta-docker branch March 3, 2020 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Work on a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants