Skip to content

Commit bbcf2ee

Browse files
rrbandakami619
authored andcommitted
fix(langgraph): address CodeRabbit review feedback
- Move USER 1001 before pip install so packages are owned by the runtime user (avoids __pycache__ permission issues) - Replace trap EXIT with explicit rm -rf in build docs (trap doesn't fire in interactive shells until terminal closes)
1 parent e10ab57 commit bbcf2ee

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

agents/langgraph/templates/react_agent/Containerfile.openshell

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ COPY --from=ghcr.io/astral-sh/uv@sha256:fc93e9ecd7218e9ec8fba117af89348eef8fd246
2929
RUN install -d -o 1001 -g 0 -m 775 /sandbox
3030
WORKDIR /sandbox
3131

32+
USER 1001
33+
3234
# Install the auth component first (resolves the path dependency issue),
3335
# then install the main package with tracing extra.
3436
COPY --chown=1001:0 components/auth/ ./components/auth/
@@ -47,8 +49,6 @@ COPY --chown=1001:0 main.py .
4749
COPY --chown=1001:0 playground/ ./playground/
4850
COPY --chown=1001:0 images/ ./images/
4951

50-
USER 1001
51-
5252
ENV PORT=8080 \
5353
PYTHONPATH=/sandbox \
5454
PATH="/opt/app-root/bin:${PATH}"

agents/langgraph/templates/react_agent/OPENSHELL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ cd agents/langgraph/templates/react_agent
1818
# Copy repo-level assets into build context
1919
cp -r ../../../../images ./images
2020
mkdir -p ./components && cp -r ../../../../components/auth ./components/auth
21-
trap 'rm -rf ./images ./components' EXIT
2221

2322
podman build --platform linux/amd64 -t quay.io/<your-org>/langgraph-sandbox:latest -f Containerfile.openshell .
2423
podman push quay.io/<your-org>/langgraph-sandbox:latest
24+
25+
# Clean up build context
26+
rm -rf ./images ./components
2527
```
2628

2729
Ensure the quay.io repository is public so the cluster can pull without imagePullSecrets.

0 commit comments

Comments
 (0)