Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Pre-commit

on:
pull_request:
branches: [main, master]
branches: [main, master, "release/**"]
push:
branches: [main, master]
branches: [main, master, "release/**"]

jobs:
pre-commit:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests

on:
pull_request:
branches: [main, master]
branches: [main, master, "release/**"]
push:
branches: [main, master]
branches: [main, master, "release/**"]

jobs:
test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@ ENV PATH="/app/venv/bin:$PATH"

WORKDIR /app

# enroot/pyxis (no-Docker SLURM clusters) start every container through
# `/bin/sh`; this distroless runtime has none, so the container fails with
# "enroot-switchroot: failed to execute: /bin/sh: No such file or directory".
# Add a static (musl) busybox as /bin/sh so the image also runs under pyxis;
# `docker run` is unaffected. COPY-only — there is no shell here to RUN with.
# busybox:*-musl is multi-arch, so the buildx --platform builds still resolve.
# enroot/pyxis starts containers through /bin/sh (switchroot); nv-sflow's srun
# operator wraps every task in `bash -c` (hardcoded in srun.py). This distroless
# runtime base has neither, so add a static busybox as /bin/sh, then create
# /bin/bash as a thin sh-wrapper via RUN (valid once /bin/sh exists above).
Comment on lines +43 to +46

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

The comment states that /bin/bash is created "via RUN", but the implementation actually uses a heredoc COPY (COPY --chmod=755 <<'EOF' /bin/bash). Updating the comment to accurately reflect the use of COPY will prevent confusion for future maintainers.

# enroot/pyxis starts containers through /bin/sh (switchroot); nv-sflow's srun
# operator wraps every task in `bash -c` (hardcoded in srun.py). This distroless
# runtime base has neither, so add a static busybox as /bin/sh, then create
# /bin/bash as a thin sh-wrapper via COPY.

# busybox:*-musl is multi-arch so buildx --platform builds still resolve.
# NOTE: do NOT copy busybox as /bin/bash — busybox-musl omits the bash applet
# and fails with "bash: applet not found" when invoked under that name.
COPY --from=busybox:1.37.0-musl /bin/busybox /bin/sh
COPY --chmod=755 <<'EOF' /bin/bash
#!/bin/sh
exec /bin/sh "$@"
EOF

COPY --from=build-stage --chmod=0555 /app/venv /app/venv
COPY --from=build-stage --chmod=0555 /opt/LiveCodeBench_Datasets /opt/LiveCodeBench_Datasets
Expand All @@ -56,7 +61,7 @@ COPY generate.py /app/lib/generate.py
COPY _server.py /app/server.py

# Make lcb_serve.py available as a module
ENV PYTHONPATH="/app:${PYTHONPATH}"
ENV PYTHONPATH="/app"

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

Overwriting PYTHONPATH completely instead of appending to it can discard any pre-configured paths set by the base image or parent environment, which may lead to unexpected import errors. It is safer to preserve the existing PYTHONPATH by appending or prepending to it.

ENV PYTHONPATH="/app:${PYTHONPATH}"


# Launch the WebSocket server with long-running connection support
# Default port 13835
Expand Down
Loading