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

Added arg to build docker with torchserve nightly #2493

Merged
merged 7 commits into from
Jul 24, 2023

Conversation

agunapal
Copy link
Collaborator

@agunapal agunapal commented Jul 22, 2023

Description

Since we moved away from using Dockerfile.dev for production, Docker nightly builds are using the official version of TorchServe

This PR adds

  • an arg to docker script to build with torchserve nightly
  • Changes docker regression scripts to use nightly
  • This setups the infra to use PyTorch nightly for docker nightlies

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

(torchserve) ubuntu@ip-172-31-8-237:~/serve/docker$ ./build_image.sh  -bt ci  -t pytorch/torchserve:latest
[+] Building 185.9s (20/20) FINISHED                                                                                                                                                      
 => [internal] load build definition from Dockerfile                                                                                                                                 0.0s
 => => transferring dockerfile: 38B                                                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                      0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                                0.3s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                                           0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                      0.3s
 => CACHED [compile-image 1/9] FROM docker.io/library/ubuntu:20.04@sha256:c9820a44b950956a790c354700c1166a7ec648bc0d215fa438d3a339812f1d01                                           0.0s
 => [compile-image 2/9] RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt     apt-get update &&     apt-get upgrade -y &&     apt-get install software-properties-common -y   94.4s
 => [compile-image 3/9] RUN python3.9 -m venv /home/venv                                                                                                                             3.1s
 => [compile-image 4/9] RUN python -m pip install -U pip setuptools                                                                                                                  3.2s 
 => [compile-image 5/9] RUN export USE_CUDA=1                                                                                                                                        0.4s 
 => [compile-image 6/9] RUN git clone --depth 1 https://github.com/pytorch/serve.git                                                                                                 2.4s 
 => [compile-image 7/9] WORKDIR serve                                                                                                                                                0.0s 
 => [compile-image 8/9] RUN     if echo "ubuntu:20.04" | grep -q "cuda:"; then         if [ "" ]; then             python ./ts_scripts/install_dependencies.py --cuda ;         el  38.1s 
 => [compile-image 9/9] RUN     if echo "false" | grep -q "false"; then         python -m pip install --no-cache-dir torchserve torch-model-archiver torch-workflow-archiver;    el  2.2s 
 => CACHED [ci-image 2/6] RUN --mount=type=cache,target=/var/cache/apt     apt-get update &&     apt-get upgrade -y &&     apt-get install software-properties-common -y &&     add  0.0s 
 => [ci-image 3/6] COPY --from=compile-image /home/venv /home/venv                                                                                                                   5.5s 
 => [ci-image 4/6] RUN python -m pip install --no-cache-dir -r https://raw.githubusercontent.com/pytorch/serve/master/requirements/developer.txt                                    26.6s 
 => [ci-image 5/6] RUN mkdir /home/serve                                                                                                                                             0.4s 
 => [ci-image 6/6] WORKDIR /home/serve                                                                                                                                               0.0s 
 => exporting to image                                                                                                                                                               5.1s 
 => => exporting layers                                                                                                                                                              5.1s 
 => => writing image sha256:f5b027ab0c1d2ac2a2193034494fb4e091b1354570bdf401cc544eb4e7620f61                                                                                         0.0s 
 => => naming to docker.io/pytorch/torchserve:latest                                                                                                                                 0.0s 
(torchserve) ubuntu@ip-172-31-8-237:~/serve/docker$ docker run -it pytorch/torchserve:latest
root@21eda49b79cb:/home/serve# pip list | grep -i torch
intel-extension-for-pytorch 2.0.100
torch                       2.0.1+cpu
torch-model-archiver        0.8.1
torch-workflow-archiver     0.2.9
torchaudio                  2.0.2+cpu
torchdata                   0.6.1
torchpippy                  0.1.1
torchserve                  0.8.1
torchtext                   0.15.2+cpu
torchvision                 0.15.2+cpu
root@21eda49b79cb:/home/serve# pip list | grep -i torchserve
torchserve                  0.8.1
root@21eda49b79cb:/home/serve# pip list | grep -i archive   
torch-model-archiver        0.8.1
torch-workflow-archiver     0.2.9
root@21eda49b79cb:/home/serve# exit
exit
(torchserve) ubuntu@ip-172-31-8-237:~/serve/docker$ ./build_image.sh -n -bt ci  -t pytorch/torchserve:nightly
[+] Building 38.1s (20/20) FINISHED                                                                                                                                                       
 => [internal] load build definition from Dockerfile                                                                                                                                 0.0s
 => => transferring dockerfile: 38B                                                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                      0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                                0.6s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                                           0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                      0.4s
 => [ci-image 1/6] FROM docker.io/library/ubuntu:20.04@sha256:c9820a44b950956a790c354700c1166a7ec648bc0d215fa438d3a339812f1d01                                                       0.0s
 => CACHED [compile-image 2/9] RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt     apt-get update &&     apt-get upgrade -y &&     apt-get install software-properties-comm  0.0s
 => CACHED [compile-image 3/9] RUN python3.9 -m venv /home/venv                                                                                                                      0.0s
 => CACHED [compile-image 4/9] RUN python -m pip install -U pip setuptools                                                                                                           0.0s
 => CACHED [compile-image 5/9] RUN export USE_CUDA=1                                                                                                                                 0.0s
 => CACHED [compile-image 6/9] RUN git clone --depth 1 https://github.com/pytorch/serve.git                                                                                          0.0s
 => CACHED [compile-image 7/9] WORKDIR serve                                                                                                                                         0.0s
 => CACHED [compile-image 8/9] RUN     if echo "ubuntu:20.04" | grep -q "cuda:"; then         if [ "" ]; then             python ./ts_scripts/install_dependencies.py --cuda ;       0.0s
 => CACHED [compile-image 9/9] RUN     if echo "true" | grep -q "false"; then         python -m pip install --no-cache-dir torchserve torch-model-archiver torch-workflow-archiver;  0.0s
 => CACHED [ci-image 2/6] RUN --mount=type=cache,target=/var/cache/apt     apt-get update &&     apt-get upgrade -y &&     apt-get install software-properties-common -y &&     add  0.0s
 => [ci-image 3/6] COPY --from=compile-image /home/venv /home/venv                                                                                                                   5.4s
 => [ci-image 4/6] RUN python -m pip install --no-cache-dir -r https://raw.githubusercontent.com/pytorch/serve/master/requirements/developer.txt                                    26.0s
 => [ci-image 5/6] RUN mkdir /home/serve                                                                                                                                             0.4s
 => [ci-image 6/6] WORKDIR /home/serve                                                                                                                                               0.0s 
 => exporting to image                                                                                                                                                               5.1s 
 => => exporting layers                                                                                                                                                              5.1s 
 => => writing image sha256:6cd9c1d2e81e2a030b2fd973347142511985d7386f29b8f1c00a02a9ca1ad086                                                                                         0.0s 
 => => naming to docker.io/pytorch/torchserve:nightly                                                                                                                                0.0s 
(torchserve) ubuntu@ip-172-31-8-237:~/serve/docker$ docker run -it pytorch/torchserve:nightly
root@f41dc46529dd:/home/serve# pip list | grep -i torchserve
torchserve-nightly              2023.7.21
root@f41dc46529dd:/home/serve# pip list | grep -i archive   
torch-model-archiver-nightly    2023.7.21
torch-workflow-archiver-nightly 2023.7.21

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@codecov
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

Merging #2493 (b03dceb) into master (6d9e870) will not change coverage.
The diff coverage is n/a.

❗ Current head b03dceb differs from pull request most recent head 8656bd0. Consider uploading reports for the commit 8656bd0 to get more accurate results

@@           Coverage Diff           @@
##           master    #2493   +/-   ##
=======================================
  Coverage   72.66%   72.66%           
=======================================
  Files          78       78           
  Lines        3669     3669           
  Branches       58       58           
=======================================
  Hits         2666     2666           
  Misses        999      999           
  Partials        4        4           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

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

You need to also update the time when the docker job runs. For example both the docker nightly build and torchserve build right now happen at the exact same time which means the docker nightly will be docker nightly day - 1

@agunapal
Copy link
Collaborator Author

@msaroufim Great catch. Updated it to run couple of hours after. Sometimes, the index doesn't update immediately

@agunapal agunapal requested a review from msaroufim July 24, 2023 17:35
@agunapal agunapal requested a review from msaroufim July 24, 2023 20:10
@agunapal agunapal merged commit 255a047 into master Jul 24, 2023
@agunapal agunapal deleted the issues/docker_nightly branch July 24, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants