Skip to content

[CI] Add HAProxy to serve CI build image - #60879

Merged
abrarsheikh merged 7 commits into
ray-project:masterfrom
eicherseiji:haproxy-serve-ci
Feb 9, 2026
Merged

abrarsheikh merged 7 commits into
ray-project:masterfrom
eicherseiji:haproxy-serve-ci

Conversation

@eicherseiji

@eicherseiji eicherseiji commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Build HAProxy 2.8.12 from source in the serve CI Docker image (ci/docker/serve.build.Dockerfile)

Context

Needed for #60586 (Ray Serve HAProxy support)

Test plan

  • Verify serve CI image builds successfully

Build HAProxy 2.8.12 from source in the serve CI image so that
HAProxy integration tests can run. Creates a dedicated haproxy
user and configures sudoers for the ray user.

Part of Ray Serve HAProxy support (ray-project#60586).

Signed-off-by: Seiji Eicher <[email protected]>
@eicherseiji eicherseiji added the go add ONLY when ready to merge, run all tests label Feb 9, 2026

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

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.

Code Review

This pull request adds HAProxy to the serve CI Docker image by building it from source. The changes are straightforward, but I've identified a critical security vulnerability in the way sudo permissions are granted to the ray user. The current configuration is overly permissive and could be exploited for privilege escalation. I've provided a detailed comment with a suggested fix that uses group permissions for file access and a more restrictive sudoers entry, which is a more secure and standard practice for managing permissions in a containerized environment.

Comment thread ci/docker/serve.build.Dockerfile Resolved
@eicherseiji
eicherseiji marked this pull request as ready for review February 9, 2026 20:19
@eicherseiji
eicherseiji requested a review from a team as a code owner February 9, 2026 20:19
Move HAProxy compilation to a separate builder stage so that build
dependencies (build-essential, libpcre3-dev, libssl-dev, etc.) are
never installed in the final CI image. Only the compiled binary is
copied via COPY --from, and only runtime deps (socat, liblua5.3-0)
are installed in the main stage.

Signed-off-by: Seiji Eicher <[email protected]>
Use the same base image for the builder stage instead of hardcoding
ubuntu:22.04, ensuring ABI compatibility if the base image changes.

Signed-off-by: Seiji Eicher <[email protected]>
Comment thread ci/docker/serve.build.Dockerfile Resolved
Comment thread ci/docker/serve.build.Dockerfile Resolved
Comment thread ci/docker/serve.build.Dockerfile Resolved
Comment thread ci/docker/serve.build.Dockerfile Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

wget -O "${HAPROXY_BUILD_DIR}/haproxy.tar.gz" "https://www.haproxy.org/download/2.8/src/haproxy-${HAPROXY_VERSION}.tar.gz"
tar -xzf "${HAPROXY_BUILD_DIR}/haproxy.tar.gz" -C "${HAPROXY_BUILD_DIR}" --strip-components=1
make -C "${HAPROXY_BUILD_DIR}" TARGET=linux-glibc USE_OPENSSL=1 USE_ZLIB=1 USE_PCRE=1 USE_LUA=1 USE_PROMEX=1 -j$(nproc)
make -C "${HAPROXY_BUILD_DIR}" install

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

HAProxy installed to wrong path in CI image

Medium Severity

The make install on line 27 is missing SBINDIR=/usr/local/bin, causing HAProxy to be installed to /usr/local/sbin/haproxy instead of /usr/local/bin/haproxy. Both production Dockerfiles (docker/base-extra/Dockerfile and docker/base-slim/Dockerfile) explicitly set SBINDIR=/usr/local/bin. This means CI tests run with HAProxy at a different path than production, potentially masking path-related failures or causing CI-only issues since /usr/local/sbin may not be in non-root users' PATH.

Additional Locations (1)

Fix in Cursor Fix in Web

@abrarsheikh
abrarsheikh merged commit 658bb65 into ray-project:master Feb 9, 2026
3 checks passed
ans9868 pushed a commit to ans9868/ray that referenced this pull request Feb 18, 2026
## Summary

- Build HAProxy 2.8.12 from source in the serve CI Docker image
(`ci/docker/serve.build.Dockerfile`)

## Context

Needed for ray-project#60586 (Ray Serve HAProxy support)

## Test plan

- [ ] Verify serve CI image builds successfully

---------

Signed-off-by: Seiji Eicher <[email protected]>
Signed-off-by: Adel Nour <[email protected]>
Aydin-ab pushed a commit to kunling-anyscale/ray that referenced this pull request Feb 20, 2026
## Summary

- Build HAProxy 2.8.12 from source in the serve CI Docker image
(`ci/docker/serve.build.Dockerfile`)

## Context

Needed for ray-project#60586 (Ray Serve HAProxy support)

## Test plan

- [ ] Verify serve CI image builds successfully

---------

Signed-off-by: Seiji Eicher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants