Skip to content

[Docker] Dockerfile improvements#8761

Closed
Swipe4057 wants to merge 5 commits intosgl-project:mainfrom
Swipe4057:update_docker_file
Closed

[Docker] Dockerfile improvements#8761
Swipe4057 wants to merge 5 commits intosgl-project:mainfrom
Swipe4057:update_docker_file

Conversation

@Swipe4057
Copy link
Copy Markdown
Contributor

@Swipe4057 Swipe4057 commented Aug 4, 2025

Motivation

This PR aims to improve the Docker image by removing duplicate apt and pip package installations, consolidating them for better maintainability. Additionally, it upgrades the base image from Ubuntu 22.04 to Ubuntu 24.04 to ensure better support, security, and access to updated packages. The NVIDIA driver version has also been updated from nvidia-dkms-550 to nvidia-dkms-575 to align with the latest stable driver supporting newer CUDA versions (12.6 and 12.9), as per NVIDIA UNIX Drivers.

Modifications

  • Removed duplicate apt and pip package installations in the Dockerfile.
  • Consolidated package installations into single commands for better clarity and maintainability.
  • Upgraded the base image from Ubuntu 22.04 to Ubuntu 24.04.
  • Updated NVIDIA driver installation from nvidia-dkms-550 to nvidia-dkms-575.
  • Python 3.10 up to 3.12.3.

Accuracy Test

N/A – This PR does not modify model-side code or affect model accuracy.

Benchmark & Profiling

N/A – No performance impact is expected from these changes. The server has been tested locally and is functioning correctly.

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 @Swipe4057, 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!

I've updated the Dockerfile to enhance maintainability and ensure better support. This involves upgrading the base Ubuntu image from 22.04 to 24.04, updating the NVIDIA driver to version 570, and streamlining package installations by removing duplicates and consolidating commands.

Highlights

  • Base Image Upgrade: The Docker image now uses Ubuntu 24.04 as its base, moving from the previous 22.04 version for improved support and access to newer packages.
  • NVIDIA Driver Update: The NVIDIA driver version has been upgraded from nvidia-dkms-550 to nvidia-dkms-570 to support newer CUDA versions.
  • Package Installation Consolidation: Duplicate apt and pip package installations have been removed, and remaining installations are consolidated into single, more maintainable commands.
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 makes several good improvements to the Dockerfile, including upgrading to Ubuntu 24.04, updating the NVIDIA driver, and consolidating package installations. The consolidation of apt and pip packages into fewer RUN layers is a great step towards a more optimized and maintainable Docker image.

My review includes a couple of suggestions to further improve the package installation process. One suggestion is to refine the apt-get consolidation to ensure there are no redundant commands or duplicate packages. Another suggestion is to replace the deprecated apt-key with the modern, more secure method for handling repository keys, which is important for compatibility with Ubuntu 24.04.

Comment thread docker/Dockerfile
Comment thread docker/Dockerfile
@zhyncs
Copy link
Copy Markdown
Collaborator

zhyncs commented Aug 4, 2025

Nice work! Can you refer to https://github.com/sgl-project/sglang/tree/zhyncs/ver

May you help add zhyncs/ver updates to this PR? Thanks!

@zhyncs
Copy link
Copy Markdown
Collaborator

zhyncs commented Aug 4, 2025

py3.13 + cu129 for blackwell

@Swipe4057
Copy link
Copy Markdown
Contributor Author

@zhyncs I'll take a look soon

@Swipe4057
Copy link
Copy Markdown
Contributor Author

@zhyncs I checked and added adaptation for CUINDEX=129. Regarding Python 3.13, according to the release cycle at https://devguide.python.org/versions/, this version is currently not stable and is in the bugfix phase. For this new image with Ubuntu 24.04, Python 3.12.3 is installed by default. I've tested it locally and believe that the stable version 3.12 should be sufficient.

@ishandhanani
Copy link
Copy Markdown
Collaborator

@Swipe4057 @zhyncs - what do you think about having an ARG at the top for the different dockerfiles we have to update the sgl-kernel wheel? Might be more ergonomic to just change it at the top of the dockerfile vs finding it somewhere below

@Swipe4057 Swipe4057 closed this Aug 5, 2025
@Swipe4057 Swipe4057 deleted the update_docker_file branch August 17, 2025 19:30
@Swipe4057 Swipe4057 restored the update_docker_file branch August 17, 2025 19:30
@Swipe4057 Swipe4057 deleted the update_docker_file branch October 11, 2025 17:23
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