Skip to content

chore: update Dockerfile#8872

Merged
zhyncs merged 5 commits intomainfrom
zhyncs/update
Aug 6, 2025
Merged

chore: update Dockerfile#8872
zhyncs merged 5 commits intomainfrom
zhyncs/update

Conversation

@mickqian
Copy link
Copy Markdown
Collaborator

@mickqian mickqian commented Aug 6, 2025

Motivation

Modifications

Accuracy Test

Benchmark & Profiling

Checklist

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @mickqian, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's Dockerfile to enhance and modernize the build environment. My changes primarily focus on refining the Python installation strategy, introducing support for a new CUDA version, and updating key dependencies to their latest versions to ensure compatibility and leverage new features.

Highlights

  • Python Environment Updates: I've refined the Python installation process within the Dockerfile. This includes explicitly installing python3.12-dev (development headers for Python 3.12) and python3.10-venv (for virtual environment support for Python 3.10), while also removing redundant generic python3 related package installations. Furthermore, the /usr/bin/python symbolic link has been updated to point directly to python3.12, reinforcing the intended default Python version.
  • CUDA 12.9.1 Support: I've added support for CUDA version 12.9.1. This involved extending the CUINDEX mapping within the Dockerfile's build logic and incorporating specific sgl_kernel wheel installations tailored for this new CUDA version.
  • Dependency Updates: The sgl_kernel dependency has been updated to version 0.3.2 for both the existing CUDA 12.8.1 and the newly supported 12.9.1 configurations. Additionally, the PyTorch extra index URL used for pip install commands has been modified to point to a /test build, suggesting a shift towards using more recent or experimental PyTorch builds.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Dockerfile to add support for a newer CUDA version and adjust Python package installations. The changes are generally in the right direction, but I've identified a critical issue with a Python version mismatch that will likely break the Docker build. I've also included suggestions to improve the robustness and readability of the Dockerfile commands. Please review my comments for details.

Comment thread docker/Dockerfile
Comment on lines 74 to 79
&& if [ "$CUDA_VERSION" = "12.8.1" ]; then \
python3 -m pip install --no-cache-dir https://github.com/sgl-project/whl/releases/download/v0.2.9/sgl_kernel-0.2.9+cu128-cp39-abi3-manylinux2014_x86_64.whl --force-reinstall --no-deps ; \
python3 -m pip install --no-cache-dir https://github.com/sgl-project/whl/releases/download/v0.3.2/sgl_kernel-0.3.2+cu128-cp39-abi3-manylinux2014_x86_64.whl --force-reinstall --no-deps ; \
fi \
&& if [ "$CUDA_VERSION" = "12.9.1" ]; then \
python3 -m pip install --no-cache-dir https://github.com/sgl-project/whl/releases/download/v0.3.2/sgl_kernel-0.3.2-cp39-abi3-manylinux2014_x86_64.whl --force-reinstall --no-deps ; \
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

I've found a few issues in this block:

  1. [Critical] Python version mismatch: The Dockerfile is set up to use Python 3.12, but the sgl_kernel wheels being installed are for Python 3.9 (cp39). This will likely cause the build to fail. The wheels should be for Python 3.12 (e.g., cp312). Please update the URLs to point to the correct wheels.

  2. [High] Inconsistent wheel filename: The wheel for CUDA 12.9.1 (sgl_kernel-0.3.2-...) is missing a CUDA version tag (e.g., +cu129) in its filename, unlike the wheel for CUDA 12.8.1 (...-0.3.2+cu128-...). This might be a typo and could result in using an incorrect wheel. Please verify the filename.

  3. [Medium] Redundant if statements: The two consecutive if statements can be refactored into a cleaner if-elif structure for better readability and maintainability.

Here is a suggested refactoring that addresses point 3 (you'll still need to fix the wheel URLs for points 1 and 2):

 && if [ "$CUDA_VERSION" = "12.8.1" ]; then \
      python3 -m pip install --no-cache-dir https://github.com/sgl-project/whl/releases/download/v0.3.2/sgl_kernel-0.3.2+cu128-cp39-abi3-manylinux2014_x86_64.whl --force-reinstall --no-deps; \
    elif [ "$CUDA_VERSION" = "12.9.1" ]; then \
      python3 -m pip install --no-cache-dir https://github.com/sgl-project/whl/releases/download/v0.3.2/sgl_kernel-0.3.2-cp39-abi3-manylinux2014_x86_64.whl --force-reinstall --no-deps; \
    fi

Comment thread docker/Dockerfile
Comment on lines 15 to +17
RUN apt update && apt install wget -y && apt install software-properties-common -y \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt install python3.12-full -y \
&& apt install python3.12-full python3.12-dev python3.10-venv -y \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This RUN command can be improved for better readability, efficiency, and robustness.

  • Combine apt-get install calls: It's more efficient to group package installations into a single apt-get install command.
  • Update after adding PPA: It's a best practice to run apt-get update after adding a new repository to ensure the package index is aware of the new packages.
  • Use --no-install-recommends: This can help reduce the final image size by avoiding installation of unnecessary recommended packages.
  • Use apt-get: apt-get is generally preferred over apt for scripting purposes as its interface is more stable.

Here is a suggested improvement for this part of the RUN command:

RUN apt-get update && \
    apt-get install -y --no-install-recommends wget software-properties-common && \
    add-apt-repository ppa:deadsnakes/ppa -y && \
    apt-get update && \
    apt-get install -y --no-install-recommends python3.12-full python3.12-dev python3.10-venv \

@zhyncs zhyncs merged commit 01c99a9 into main Aug 6, 2025
18 checks passed
@zhyncs zhyncs deleted the zhyncs/update branch August 6, 2025 16:30
narutolhy pushed a commit to narutolhy/sglang that referenced this pull request Aug 17, 2025
Co-authored-by: zhyncs <me@zhyncs.com>
MahmoudAshraf97 pushed a commit to MahmoudAshraf97/sglang that referenced this pull request Sep 8, 2025
Co-authored-by: zhyncs <me@zhyncs.com>
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.

2 participants