Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
6dc9ca8c
Unverified
Commit
6dc9ca8c
authored
Oct 13, 2025
by
Arthur Cheng
Committed by
GitHub
Oct 13, 2025
Browse files
[router] Add BRANCH_TYPE=local support to Dockerfile.router for local builds (#11571)
parent
887c2b45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
docker/Dockerfile.router
docker/Dockerfile.router
+18
-6
No files found.
docker/Dockerfile.router
View file @
6dc9ca8c
...
@@ -29,10 +29,14 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
...
@@ -29,10 +29,14 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# install python
# install python
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
FROM scratch AS local_src
COPY . /src
######################### BUILD IMAGE #########################
######################### BUILD IMAGE #########################
FROM base AS build-image
FROM base AS build-image
ARG SGLANG_REPO_REF=main
ARG SGLANG_REPO_REF=main
ARG BRANCH_TYPE=remote
# set the environment variables
# set the environment variables
ENV PATH="/root/.cargo/bin:${PATH}"
ENV PATH="/root/.cargo/bin:${PATH}"
...
@@ -47,17 +51,25 @@ RUN apt update -y \
...
@@ -47,17 +51,25 @@ RUN apt update -y \
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& rustc --version && cargo --version && protoc --version
&& rustc --version && cargo --version && protoc --version
# pull the github repository
# pull the github repository or use local source
RUN cd /opt \
COPY --from=local_src /src /tmp/local_src
&& git clone --depth=1 https://github.com/sgl-project/sglang.git \
RUN if [ "$BRANCH_TYPE" = "local" ]; then \
&& cd /opt/sglang \
cp -r /tmp/local_src /opt/sglang; \
&& git checkout ${SGLANG_REPO_REF}
else \
cd /opt \
&& git clone --depth=1 https://github.com/sgl-project/sglang.git \
&& cd /opt/sglang \
&& git checkout ${SGLANG_REPO_REF}; \
fi \
&& rm -rf /tmp/local_src
# working directory
# working directory
WORKDIR /opt/sglang/sgl-router
WORKDIR /opt/sglang/sgl-router
# build the rust dependencies
# build the rust dependencies
RUN cargo build --release \
RUN cargo clean \
&& rm -rf dist/ \
&& cargo build --release \
&& uv build \
&& uv build \
&& rm -rf /root/.cache
&& rm -rf /root/.cache
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment