- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.5k
fix dockerfile definitions. #12424
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
                    fix dockerfile definitions. #12424
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            13 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      98bd0a9
              
                fix dockerfile definitions.
              
              
                sayakpaul 6c7ce35
              
                python 3.10 slim.
              
              
                sayakpaul 230cc08
              
                up
              
              
                sayakpaul 86336a1
              
                up
              
              
                sayakpaul 10852f0
              
                up
              
              
                sayakpaul 3d264b5
              
                up
              
              
                sayakpaul 4ab04bc
              
                up
              
              
                sayakpaul a83428d
              
                revert pr_tests.yml changes
              
              
                sayakpaul 2cc2b92
              
                up
              
              
                sayakpaul ab2a1df
              
                up
              
              
                sayakpaul 87ffc4d
              
                reduce python version for torch 2.1.0
              
              
                sayakpaul a0fdfa5
              
                Merge branch 'main' into docker-build-fixes
              
              
                sayakpaul 7a731d7
              
                Merge branch 'main' into docker-build-fixes
              
              
                sayakpaul 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
    
  
  
    
              
  
    
      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 | 
|---|---|---|
|  | @@ -286,4 +286,3 @@ jobs: | |
| with: | ||
| name: pr_main_test_reports | ||
| path: reports | ||
|  | ||
  
    
      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 | 
|---|---|---|
| @@ -1,56 +1,42 @@ | ||
| FROM ubuntu:20.04 | ||
| FROM python:3.10-slim | ||
| ENV PYTHONDONTWRITEBYTECODE=1 | ||
| LABEL maintainer="Hugging Face" | ||
| LABEL repository="diffusers" | ||
|  | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|  | ||
| RUN apt-get -y update \ | ||
| && apt-get install -y software-properties-common \ | ||
| && add-apt-repository ppa:deadsnakes/ppa | ||
|  | ||
| RUN apt install -y bash \ | ||
| build-essential \ | ||
| git \ | ||
| git-lfs \ | ||
| curl \ | ||
| ca-certificates \ | ||
| libsndfile1-dev \ | ||
| python3.10 \ | ||
| python3-pip \ | ||
| libgl1 \ | ||
| zip \ | ||
| wget \ | ||
| python3.10-venv && \ | ||
| rm -rf /var/lib/apt/lists | ||
|  | ||
| # make sure to use venv | ||
| RUN python3.10 -m venv /opt/venv | ||
| ENV PATH="/opt/venv/bin:$PATH" | ||
| RUN apt-get -y update && apt-get install -y bash \ | ||
| build-essential \ | ||
| git \ | ||
| git-lfs \ | ||
| curl \ | ||
| ca-certificates \ | ||
| libsndfile1-dev \ | ||
| libgl1 | ||
|  | ||
| ENV UV_PYTHON=/usr/local/bin/python | ||
|  | ||
| # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) | ||
| RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ | ||
| python3.10 -m uv pip install --no-cache-dir \ | ||
| torch \ | ||
| torchvision \ | ||
| torchaudio \ | ||
| invisible_watermark \ | ||
| --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| python3.10 -m uv pip install --no-cache-dir \ | ||
| accelerate \ | ||
| datasets \ | ||
| hf-doc-builder \ | ||
| huggingface-hub \ | ||
| Jinja2 \ | ||
| librosa \ | ||
| numpy==1.26.4 \ | ||
| scipy \ | ||
| tensorboard \ | ||
| transformers \ | ||
| matplotlib \ | ||
| setuptools==69.5.1 \ | ||
| bitsandbytes \ | ||
| torchao \ | ||
| gguf \ | ||
| optimum-quanto | ||
| RUN pip install uv | ||
| RUN uv pip install --no-cache-dir \ | ||
| torch \ | ||
| torchvision \ | ||
| torchaudio \ | ||
| --extra-index-url https://download.pytorch.org/whl/cpu | ||
|  | ||
| RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]" | ||
|  | ||
| # Extra dependencies | ||
| RUN uv pip install --no-cache-dir \ | ||
| accelerate \ | ||
| numpy==1.26.4 \ | ||
| hf_transfer \ | ||
| setuptools==69.5.1 \ | ||
| bitsandbytes \ | ||
| torchao \ | ||
| gguf \ | ||
| optimum-quanto | ||
|  | ||
| RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean | ||
|  | ||
| CMD ["/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 | 
|---|---|---|
| @@ -1,50 +1,37 @@ | ||
| FROM ubuntu:20.04 | ||
| FROM python:3.10-slim | ||
| ENV PYTHONDONTWRITEBYTECODE=1 | ||
| LABEL maintainer="Hugging Face" | ||
| LABEL repository="diffusers" | ||
|  | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|  | ||
| RUN apt-get -y update \ | ||
| && apt-get install -y software-properties-common \ | ||
| && add-apt-repository ppa:deadsnakes/ppa | ||
|  | ||
| RUN apt install -y bash \ | ||
| build-essential \ | ||
| git \ | ||
| git-lfs \ | ||
| curl \ | ||
| ca-certificates \ | ||
| libsndfile1-dev \ | ||
| python3.10 \ | ||
| python3.10-dev \ | ||
| python3-pip \ | ||
| libgl1 \ | ||
| python3.10-venv && \ | ||
| rm -rf /var/lib/apt/lists | ||
|  | ||
| # make sure to use venv | ||
| RUN python3.10 -m venv /opt/venv | ||
| ENV PATH="/opt/venv/bin:$PATH" | ||
| RUN apt-get -y update && apt-get install -y bash \ | ||
| build-essential \ | ||
| git \ | ||
| git-lfs \ | ||
| curl \ | ||
| ca-certificates \ | ||
| libsndfile1-dev \ | ||
| libgl1 | ||
|  | ||
| ENV UV_PYTHON=/usr/local/bin/python | ||
|  | ||
| # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) | ||
| RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ | ||
| python3.10 -m uv pip install --no-cache-dir \ | ||
| torch \ | ||
| torchvision \ | ||
| torchaudio \ | ||
| invisible_watermark \ | ||
| --extra-index-url https://download.pytorch.org/whl/cpu && \ | ||
| python3.10 -m uv pip install --no-cache-dir \ | ||
| accelerate \ | ||
| datasets \ | ||
| hf-doc-builder \ | ||
| huggingface-hub \ | ||
| Jinja2 \ | ||
| librosa \ | ||
| numpy==1.26.4 \ | ||
| scipy \ | ||
| tensorboard \ | ||
| transformers matplotlib \ | ||
| hf_transfer | ||
| RUN pip install uv | ||
| RUN uv pip install --no-cache-dir \ | ||
| torch \ | ||
| torchvision \ | ||
| torchaudio \ | ||
| --extra-index-url https://download.pytorch.org/whl/cpu | ||
|  | ||
| RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]" | ||
|  | ||
| # Extra dependencies | ||
| RUN uv pip install --no-cache-dir \ | ||
| accelerate \ | ||
| numpy==1.26.4 \ | ||
| hf_transfer | ||
|  | ||
| RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean | ||
|  | ||
| CMD ["/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
    
  
  
    
              
  
    
      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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? We already install test deps in the workflow file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so in a future PR (immediately after this one), I will remove that step so that we can save some time skipping those installs.