From 13c5c7cffa0b3c13b2269fca815a79a0da3a7c54 Mon Sep 17 00:00:00 2001 From: Shumatsurontek Date: Fri, 3 Apr 2026 11:15:38 +0200 Subject: [PATCH] cache tree-sitter parsers in sandbox Docker image Pre-download tree-sitter language parsers at build time so they are available at runtime without network access. --- evaluator/sandbox/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/evaluator/sandbox/Dockerfile b/evaluator/sandbox/Dockerfile index d217c88a9..bbdf754b0 100644 --- a/evaluator/sandbox/Dockerfile +++ b/evaluator/sandbox/Dockerfile @@ -13,6 +13,12 @@ RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r /tmp/packages_py.txt && \ rm /tmp/packages_py.txt +# Pre-download tree-sitter language parsers (no network in sandbox at runtime) +RUN python -c "\ +from tree_sitter_language_pack import get_language; \ +[get_language(lang) for lang in ['python', 'javascript', 'typescript', 'java', 'go', 'ruby', 'rust', 'c', 'cpp', 'c_sharp']];\ +print('Tree-sitter parsers cached successfully')" || echo "Tree-sitter pre-cache skipped" + RUN pip cache purge && \ rm -rf /root/.cache/pip