Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docker/hvd/Dockerfile.hvd-apex
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ RUN apt-get update && \

# Ignite main dependencies
RUN pip install tensorboardX tensorboard trains tqdm && \
# Horovod support is available in >0.4.1 and in nightly releases:
pip install --pre pytorch-ignite
pip install pytorch-ignite

# Checkout Ignite examples only
RUN mkdir -p pytorch-ignite-examples && \
Expand Down
3 changes: 1 addition & 2 deletions docker/hvd/Dockerfile.hvd-base
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ RUN apt-get update && \

# Ignite main dependencies
RUN pip install tensorboardX tensorboard trains tqdm && \
# Horovod support is available in >0.4.1 and in nightly releases:
pip install --pre pytorch-ignite
pip install pytorch-ignite

# Checkout Ignite examples only
RUN mkdir -p pytorch-ignite-examples && \
Expand Down
31 changes: 31 additions & 0 deletions docker/hvd/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo "Build all Horovod flavoured PyTorch-Ignite images"

# Start script from ignite docker folder
if [ ! -d hvd ]; then
echo "Can not find 'hvd' folder"
echo "Usage: sh hvd/build_all.sh"
exit 1
fi

curr_dir=$PWD
cd $curr_dir/hvd

set -xeu

image_name="hvd-base"

docker build -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} .
image_tag=`docker run --rm -it pytorchignite/${image_name}:latest -c 'python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"'`
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}

for image_name in "hvd-vision" "hvd-nlp" "hvd-apex" "hvd-apex-vision" "hvd-apex-nlp"
do

docker build -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} .
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}

done

cd $curr_dir
31 changes: 31 additions & 0 deletions docker/main/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo "Build all PyTorch-Ignite images"

# Start script from ignite docker folder
if [ ! -d main ]; then
echo "Can not find 'main' folder"
echo "Usage: sh main/build_all.sh"
exit 1
fi

curr_dir=$PWD
cd $curr_dir/main

set -xeu

image_name="base"

docker build -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} .
image_tag=`docker run --rm -it pytorchignite/${image_name}:latest -c 'python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"'`
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}

for image_name in "vision" "nlp" "apex" "apex-vision" "apex-nlp"
do

docker build -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} .
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}

done

cd $curr_dir
31 changes: 31 additions & 0 deletions docker/msdp/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo "Build all MS DeepSpeed flavoured PyTorch-Ignite images"

# Start script from ignite docker folder
if [ ! -d msdp ]; then
echo "Can not find 'msdp' folder"
echo "Usage: sh msdp/build_all.sh"
exit 1
fi

curr_dir=$PWD
cd $curr_dir/msdp

set -xeu

image_name="msdp-apex-base"

docker build -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} .
image_tag=`docker run --rm -it pytorchignite/${image_name}:latest -c 'python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"'`
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}

for image_name in "msdp-apex-vision" "msdp-apex-nlp"
do

docker build -t pytorchignite/${image_name}:latest -f Dockerfile.${image_name} .
docker tag pytorchignite/${image_name}:latest pytorchignite/${image_name}:${image_tag}

done

cd $curr_dir
60 changes: 60 additions & 0 deletions docker/push_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

echo "Push all PyTorch-Ignite docker images"

if [ -z $DOCKER_USER ]; then
echo "Can not find DOCKER_USER env variable"
echo "Please, export DOCKER_USER=<username> before calling this script"
exit 1
fi

if [ -z $DOCKER_TOKEN ]; then
echo "Can not find DOCKER_TOKEN env variable"
echo "Please, export DOCKER_TOKEN=<token> before calling this script"
exit 1
fi

set -eu

echo $DOCKER_TOKEN | docker login --username=$DOCKER_USER --password-stdin

set -xeu

image_name="base"
image_tag=`docker run --rm -it pytorchignite/${image_name}:latest -c 'python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"'`

for image_name in "base" "vision" "nlp" "apex" "apex-vision" "apex-nlp"
do

docker push pytorchignite/${image_name}:latest
docker push pytorchignite/${image_name}:${image_tag}

done


image_name="hvd-base"
image_tag=`docker run --rm -it pytorchignite/${image_name}:latest -c 'python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"'`

for image_name in "hvd-base" "hvd-vision" "hvd-nlp" "hvd-apex" "hvd-apex-vision" "hvd-apex-nlp"
do

docker push pytorchignite/${image_name}:latest
docker push pytorchignite/${image_name}:${image_tag}

done

image_name="msdp-apex-base"
image_tag=`docker run --rm -it pytorchignite/${image_name}:latest -c 'python -c "import torch; import ignite; print(torch.__version__ + \"-\" + ignite.__version__, end=\"\")"'`

for image_name in "msdp-apex-base" "msdp-apex-vision" "msdp-apex-nlp"
do

docker push pytorchignite/${image_name}:latest
docker push pytorchignite/${image_name}:${image_tag}

done

# If use locally, mind to clean dangling images
# docker images | grep 'pytorchignite\|<none>' | awk '{print $3}' | xargs docker rmi -f
# or
# docker image prune