Skip to content

Commit 670ccba

Browse files
committed
chore: Update CI workflows to use specific Docker images for deployment
- Changed the Docker image references in CI workflows (`ci.yml`, `nightly.yml`, `release.yml`, `runtime.yml`) to point to `ghcr.io/usnavy13/librecodeinterpreter` and its associated runtime images. - Added validation for empty code submissions in the `execute_code` function within `exec.py`. - Improved code formatting in `programmatic.py` for better readability.
1 parent d3a0923 commit 670ccba

7 files changed

Lines changed: 27 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ permissions:
1818

1919
env:
2020
PYTHON_VERSION: "3.11"
21-
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
22-
RUNTIME_R_IMAGE: ghcr.io/${{ github.repository }}/runtime-r
23-
BUILDCACHE_IMAGE: ghcr.io/${{ github.repository }}/buildcache
21+
REGISTRY_IMAGE: ghcr.io/usnavy13/librecodeinterpreter
22+
RUNTIME_R_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/runtime-r
23+
BUILDCACHE_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/buildcache
2424
LOCAL_API_IMAGE_AMD64: code-interpreter:ci-amd64
2525
LOCAL_API_IMAGE_ARM64: code-interpreter:ci-arm64
2626

.github/workflows/nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ permissions:
1515

1616
env:
1717
PYTHON_VERSION: "3.11"
18-
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
19-
RUNTIME_CORE_IMAGE: ghcr.io/${{ github.repository }}/runtime-core
20-
RUNTIME_R_IMAGE: ghcr.io/${{ github.repository }}/runtime-r
21-
BUILDCACHE_IMAGE: ghcr.io/${{ github.repository }}/buildcache
18+
REGISTRY_IMAGE: ghcr.io/usnavy13/librecodeinterpreter
19+
RUNTIME_CORE_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/runtime-core
20+
RUNTIME_R_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/runtime-r
21+
BUILDCACHE_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/buildcache
2222
LOCAL_API_IMAGE_AMD64: code-interpreter:nightly-amd64
2323
LOCAL_API_IMAGE_ARM64: code-interpreter:nightly-arm64
2424

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ permissions:
1616

1717
env:
1818
PYTHON_VERSION: "3.11"
19-
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
20-
RUNTIME_R_IMAGE: ghcr.io/${{ github.repository }}/runtime-r
21-
BUILDCACHE_IMAGE: ghcr.io/${{ github.repository }}/buildcache
19+
REGISTRY_IMAGE: ghcr.io/usnavy13/librecodeinterpreter
20+
RUNTIME_R_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/runtime-r
21+
BUILDCACHE_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/buildcache
2222

2323
jobs:
2424
prepare:

.github/workflows/runtime.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ permissions:
1818
packages: write
1919

2020
env:
21-
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
22-
RUNTIME_CORE_IMAGE: ghcr.io/${{ github.repository }}/runtime-core
23-
RUNTIME_R_IMAGE: ghcr.io/${{ github.repository }}/runtime-r
24-
BUILDCACHE_IMAGE: ghcr.io/${{ github.repository }}/buildcache
21+
REGISTRY_IMAGE: ghcr.io/usnavy13/librecodeinterpreter
22+
RUNTIME_CORE_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/runtime-core
23+
RUNTIME_R_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/runtime-r
24+
BUILDCACHE_IMAGE: ghcr.io/usnavy13/librecodeinterpreter/buildcache
2525

2626
jobs:
2727
prepare:

src/api/exec.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ async def execute_code(
8585
state_archival_service=state_archival_service,
8686
)
8787

88+
# Streaming responses send headers before iterating the body. Validate
89+
# synchronously first so handled request errors still return proper HTTP codes.
90+
if not request.code or not request.code.strip():
91+
raise ValidationError(message="Code cannot be empty")
92+
8893
async def _stream_response():
8994
"""Execute code and stream the response with keepalive whitespace.
9095

src/middleware/security.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ async def _validate_request(self, request: Request):
120120
"""Validate request content type."""
121121
# Only validate content type for non-file upload requests.
122122
# File uploads are handled by the files API with specific validation.
123-
if (
124-
request.method in ["POST", "PUT", "PATCH"]
125-
and not request.url.path.startswith("/upload")
126-
):
123+
if request.method in [
124+
"POST",
125+
"PUT",
126+
"PATCH",
127+
] and not request.url.path.startswith("/upload"):
127128
content_type = request.headers.get("content-type", "")
128129
allowed_types = [
129130
"application/json",

src/services/programmatic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,9 @@ async def _mount_referenced_file(
597597
f"{file_info.session_id}/{file_info.id}"
598598
)
599599

600-
filename = self._normalize_mount_filename(file_info.name or stored_file.filename)
600+
filename = self._normalize_mount_filename(
601+
file_info.name or stored_file.filename
602+
)
601603
self._sandbox_manager.copy_content_to_sandbox(
602604
sandbox_info,
603605
content,

0 commit comments

Comments
 (0)