Skip to content

Commit 08b3a7d

Browse files
author
Hanbin Hu
authored
Docker release (#94)
* Docker flow * Dependency remove * Update docker version * Add docker hub library name * Add docker hub library name for re-tagging * GPU Dockerfile update * Clean up docker hub release flow
1 parent 58a28da commit 08b3a7d

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

.github/workflows/release.yml

+24
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,27 @@ jobs:
5959
run: |
6060
python setup.py sdist
6161
twine upload dist/*
62+
docker:
63+
name: DockerHub Release
64+
needs: deploy
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@v2
69+
- name: Build CPU image
70+
run: docker build . --file dockerfile.cpu --tag bluefog:cpu
71+
- name: Build GPU image
72+
run: docker build . --file dockerfile.gpu --tag bluefog:gpu
73+
- name: Log into DockerHub
74+
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
75+
- name: Push image
76+
run: |
77+
# Strip git ref prefix from version
78+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
79+
# Strip "v" prefix from tag name
80+
VERSION=$(echo $VERSION | sed -e 's/^v//')
81+
echo VERSION=$VERSION
82+
docker tag bluefog:cpu bluefoglib/bluefog:cpu-$VERSION
83+
docker tag bluefog:gpu bluefoglib/bluefog:gpu-$VERSION
84+
docker push bluefoglib/bluefog:cpu-$VERSION
85+
docker push bluefoglib/bluefog:gpu-$VERSION

dockerfile.gpu

+5-6
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ RUN pip install torch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} -f
7474
RUN pip install "Pillow<7.0" --no-deps
7575

7676
# Install Bluefog
77-
RUN pip install bluefog
78-
79-
RUN mkdir /bluefog
80-
RUN cd /bluefog && \
77+
CMD pip install bluefog && \
78+
cd /bluefog && \
8179
VERSION=`python -c "import bluefog; print(bluefog.__version__)"` && \
8280
wget https://github.com/Bluefog-Lib/bluefog/releases/download/v$VERSION/examples.tar.gz && \
83-
tar -zxv -f examples.tar.gz && \
84-
rm examples.tar.gz
81+
tar -zx -f examples.tar.gz && \
82+
rm examples.tar.gz && \
83+
bash
8584

8685
WORKDIR "bluefog"

docs/docker.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Downloading Docker Image From Docker Hub
2323

2424
.. code-block:: bash
2525
26-
sudo docker pull bluefoglib/bluefog:gpu-0.2.2
26+
sudo docker pull bluefoglib/bluefog:gpu-0.3.0
2727
2828
2. Download docker image with only CPU support:
2929

3030
.. code-block:: bash
3131
32-
sudo docker pull bluefoglib/bluefog:cpu-0.2.2
32+
sudo docker pull bluefoglib/bluefog:cpu-0.3.0
3333
3434
Building Your Own Docker Image
3535
##############################

0 commit comments

Comments
 (0)