-
-
Notifications
You must be signed in to change notification settings - Fork 648
Docker for users #1214 #1218
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
Merged
Merged
Docker for users #1214 #1218
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
be3e913
Docker for users #1214
fco-dv 929bf7f
Merge branch 'master' into docker
sdesrozis 07416a8
Docker for users #1214
fco-dv 463e6ec
Docker for users #1214
fco-dv f9a6308
Merge branch 'master' into docker
sdesrozis 5ffce76
Docker for users #1214
fco-dv 8ab687a
Update README.md
vfdev-5 11aba4d
Merge branch 'master' into docker
vfdev-5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Docker for users | ||
|
||
We provide Dockerfiles in order to build containerized execution environment that ease the use of Ignite for computer vision and NLP tasks. | ||
|
||
## Installation | ||
|
||
- [main/Dockerfile.base](main/Dockerfile.base): latest stable PyTorch, Ignite with minimal dependencies | ||
* `docker pull pytorchignite/base:latest` | ||
- [main/Dockerfile.vision](main/Dockerfile.vision): base image with useful computer vision libraries | ||
* `docker pull pytorchignite/vision:latest` | ||
- [main/Dockerfile.nlp](main/Dockerfile.nlp): base image with useful NLP libraries | ||
* `docker pull pytorchignite/nlp:latest` | ||
- [main/Dockerfile.apex](main/Dockerfile.apex): multi-stage NVIDIA/apex build with latest Pytorch, Ignite image with minimal dependencies | ||
* `docker pull pytorchignite/apex:latest` | ||
- [main/Dockerfile.apex-vision](main/Dockerfile.nlp): base apex with useful computer vision libraries | ||
* `docker pull pytorchignite/apex-vision:latest` | ||
- [main/Dockerfile.apex-nlp](main/Dockerfile.nlp): base apex with useful NLP libraries | ||
* `docker pull pytorchignite/apex-nlp:latest` | ||
|
||
## How to use | ||
|
||
```bash | ||
docker run --rm -it -v $PWD:/workspace/project --network=host --shm-size 16G pytorchignite/base:latest | ||
``` |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Multi-stage build | ||
# 1/Building apex with pytorch:1.6.0-cuda10.1-cudnn7-devel | ||
FROM pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel AS apex-builder | ||
|
||
ARG ARG_TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.5" | ||
ENV TORCH_CUDA_ARCH_LIST=$ARG_TORCH_CUDA_ARCH_LIST | ||
|
||
# Install git | ||
RUN apt-get update && apt-get install -y --no-install-recommends git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Build apex | ||
RUN echo "Setup NVIDIA Apex" && \ | ||
tmp_apex_path="/tmp/apex" && \ | ||
rm -rf $tmp_apex_path && \ | ||
git clone https://github.com/NVIDIA/apex $tmp_apex_path && \ | ||
cd $tmp_apex_path && \ | ||
pip wheel --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" . | ||
|
||
# 2/ Build the runtime image | ||
FROM pytorch/pytorch:latest | ||
|
||
COPY --from=apex-builder /tmp/apex/apex-0.1-cp37-cp37m-linux_x86_64.whl apex-0.1-cp37-cp37m-linux_x86_64.whl | ||
RUN pip install --no-cache-dir apex-0.1-cp37-cp37m-linux_x86_64.whl && \ | ||
rm apex-0.1-cp37-cp37m-linux_x86_64.whl | ||
|
||
# Install tzdata / git | ||
RUN apt-get update && \ | ||
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ | ||
apt-get install -y tzdata && \ | ||
dpkg-reconfigure --frontend noninteractive tzdata && \ | ||
apt-get -y install --no-install-recommends git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Ignite main dependencies | ||
RUN pip install --upgrade --no-cache-dir pytorch-ignite \ | ||
tensorboard \ | ||
tqdm | ||
|
||
# Checkout Ignite examples only | ||
RUN mkdir -p pytorch-ignite-examples && \ | ||
cd pytorch-ignite-examples && \ | ||
git init && \ | ||
git config core.sparsecheckout true && \ | ||
echo examples >> .git/info/sparse-checkout && \ | ||
git remote add -f origin https://github.com/pytorch/ignite.git && \ | ||
git pull origin master | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Dockerfile.apex-nlp | ||
FROM pytorchignite/apex | ||
|
||
# Ignite NLP dependencies | ||
RUN pip install --upgrade --no-cache-dir torchtext \ | ||
transformers \ | ||
spacy \ | ||
nltk | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Dockerfile.apex-vision | ||
FROM pytorchignite/apex | ||
|
||
# Install opencv dependencies | ||
RUN apt-get update && \ | ||
apt-get -y install --no-install-recommends libglib2.0 \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Ignite vision dependencies | ||
RUN pip install --upgrade --no-cache-dir albumentations \ | ||
image-dataset-viz \ | ||
numpy \ | ||
opencv-python \ | ||
py_config_runner \ | ||
pillow \ | ||
"trains>=0.15.0" | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Dockerfile.base | ||
FROM pytorch/pytorch:latest | ||
|
||
# Install tzdata / git | ||
RUN apt-get update && \ | ||
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ | ||
apt-get install -y tzdata && \ | ||
dpkg-reconfigure --frontend noninteractive tzdata && \ | ||
apt-get -y install --no-install-recommends git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Ignite main dependencies | ||
RUN pip install --upgrade --no-cache-dir pytorch-ignite \ | ||
tensorboard \ | ||
tqdm | ||
# Checkout Ignite examples only | ||
RUN mkdir -p pytorch-ignite-examples && \ | ||
vfdev-5 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cd pytorch-ignite-examples && \ | ||
git init && \ | ||
git config core.sparsecheckout true && \ | ||
echo examples >> .git/info/sparse-checkout && \ | ||
git remote add -f origin https://github.com/pytorch/ignite.git && \ | ||
git pull origin master | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Dockerfile.nlp | ||
FROM pytorchignite/base:latest | ||
|
||
# Ignite NLP dependencies | ||
RUN pip install --upgrade --no-cache-dir torchtext \ | ||
transformers \ | ||
spacy \ | ||
nltk | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Dockerfile.vision | ||
FROM pytorchignite/base:latest | ||
|
||
# Install opencv dependencies | ||
RUN apt-get update && \ | ||
apt-get -y install --no-install-recommends libglib2.0 \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Ignite vision dependencies | ||
RUN pip install --upgrade --no-cache-dir albumentations \ | ||
image-dataset-viz \ | ||
numpy \ | ||
opencv-python \ | ||
py_config_runner \ | ||
pillow \ | ||
"trains>=0.15.0" | ||
|
||
ENTRYPOINT ["/bin/bash"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.