Skip to content

Commit 661c69c

Browse files
net0wellclaude
andcommitted
fix(hosts): temporários no volume de trabalho (spec 009)
Com a raiz somente leitura, a publicação de uma Etapa falhava: a checagem de sintaxe criava /tmp/psr-syntax. Ela agora usa o WorkRoot. As imagens apontam TMPDIR para /tmp/psr/tmp, criado pelo entrypoint; lá vão o buffer de requisições do ASP.NET Core e o spool de arquivos. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a44a3f9 commit 661c69c

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎hosts/PythonScriptRunner.DashboardHost/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ RUN groupadd --gid 10001 psr \
4747
COPY --from=psrunner /wheel/ /opt/psr/
4848
COPY --chmod=755 hosts/docker/entrypoint.sh /opt/psr/entrypoint.sh
4949
ENV HOME=/var/lib/psr \
50+
TMPDIR=/tmp/psr/tmp \
5051
ASPNETCORE_HTTP_PORTS=8080 \
5152
UV_PYTHON_INSTALL_DIR=/var/lib/psr/python \
5253
UV_CACHE_DIR=/var/lib/psr/envs/.uv-cache \

‎hosts/PythonScriptRunner.WorkerHost/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ RUN groupadd --gid 10001 psr \
3939
COPY --from=psrunner /wheel/ /opt/psr/
4040
COPY --chmod=755 hosts/docker/entrypoint.sh /opt/psr/entrypoint.sh
4141
ENV HOME=/var/lib/psr \
42+
TMPDIR=/tmp/psr/tmp \
4243
ASPNETCORE_HTTP_PORTS=8080 \
4344
UV_PYTHON_INSTALL_DIR=/var/lib/psr/python \
4445
UV_CACHE_DIR=/var/lib/psr/envs/.uv-cache \

‎hosts/docker/entrypoint.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Entrada das imagens dos hosts (spec 009): usa o psrunner embutido na imagem (D-169), a menos que
33
# PythonScriptRunner__PsrunnerRequirement já venha definido (por exemplo, um índice privado).
44
set -e
5+
# Arquivos temporários (buffer de requisições do ASP.NET Core, spool de arquivos) vão para o volume de trabalho: a raiz
6+
# pode ser somente leitura.
7+
mkdir -p "${TMPDIR:-/tmp}"
58
if [ -z "${PythonScriptRunner__PsrunnerRequirement:-}" ]; then
69
for wheel in /opt/psr/psrunner-*.whl; do
710
PythonScriptRunner__PsrunnerRequirement="$wheel"

‎src/PythonScriptRunner.Core/Environments/UvEnvironmentManager.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ with open(sys.argv[1], encoding="utf-8") as source_file:
4242
public async Task<ScriptSyntaxError?> CheckSyntaxAsync(string? pythonVersion, string script, CancellationToken cancellationToken = default)
4343
{
4444
ArgumentNullException.ThrowIfNull(script);
45-
var folder = Path.Combine(Path.GetTempPath(), "psr-syntax", Guid.NewGuid().ToString("N"));
45+
// Inside WorkRoot: a container with a read-only root file system only writes its volumes.
46+
var folder = Path.Combine(options.Value.WorkRoot, "syntax", Guid.NewGuid().ToString("N"));
4647
Directory.CreateDirectory(folder);
4748
try
4849
{

0 commit comments

Comments
 (0)