From 665b8b28f8688f9e8e62fcf1e3c43a39861a49b7 Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 14:07:21 +0200 Subject: [PATCH 1/7] fix: correct GPU pip install command --- Dockerfile.gpu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index f4e7629..9a53688 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -16,7 +16,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ WORKDIR /app RUN python -m pip install --upgrade pip \ - && python -m pip install install torch torchvision --index-url https://download.pytorch.org/whl/cu132 \ + && python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu132 \ && python -m pip install numpy transformers COPY src ./src From 79a10aef49b9aeb3b0e011937d2d9a9f786cdac5 Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 14:07:46 +0200 Subject: [PATCH 2/7] fix: align Docker static checks with working CPU/GPU images --- .github/workflows/gpu-static-check.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gpu-static-check.yml b/.github/workflows/gpu-static-check.yml index 891d7ee..a734750 100644 --- a/.github/workflows/gpu-static-check.yml +++ b/.github/workflows/gpu-static-check.yml @@ -88,14 +88,20 @@ jobs: - name: Verify zero-install Docker paths run: | - grep -q 'torch torchvision' Dockerfile.cpu - grep -q 'download.pytorch.org/whl/cpu' Dockerfile.cpu - grep -q 'COPY run_gpu.py run_cpu.py' Dockerfile.cpu + # Keep the known-working Dockerfile installation style. Do not require + # version pins or a dedicated CPU wheel index for the CPU image. + grep -Fq 'python -m pip install torch torchvision' Dockerfile.cpu + grep -Fq 'python -m pip install numpy transformers' Dockerfile.cpu + grep -Fq 'COPY run_gpu.py run_cpu.py ./' Dockerfile.cpu ! grep -q 'pip install \.' Dockerfile.cpu - grep -q 'torch torchvision' Dockerfile.gpu - grep -q 'download.pytorch.org/whl/cu132' Dockerfile.gpu - grep -q 'COPY run_gpu.py' Dockerfile.gpu + + # GPU keeps the same style but must use the CUDA 13.2 wheel index. + grep -Fq 'python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu132' Dockerfile.gpu + grep -Fq 'python -m pip install numpy transformers' Dockerfile.gpu + grep -Fq 'COPY run_gpu.py ./run_gpu.py' Dockerfile.gpu + ! grep -Fq 'pip install install' Dockerfile.gpu ! grep -q 'pip install \.' Dockerfile.gpu + grep -q 'gpus: all' docker-compose.yml grep -q 'test-cpu:' docker-compose.yml grep -q 'test-gpu:' docker-compose.yml From dcc705b42903401b19acad33a9a28c40deb7e12c Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 15:08:13 +0200 Subject: [PATCH 3/7] fix: enforce LF line endings for shell and Docker files --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..618e6ec --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Keep Linux shell scripts executable with Unix line endings even when cloned on Windows. +*.sh text eol=lf +Dockerfile* text eol=lf +*.yml text eol=lf +*.yaml text eol=lf From bf44d59b95ad54fc62af991a91c77c6d1b958aab Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 15:09:40 +0200 Subject: [PATCH 4/7] fix: normalize GPU shell script line endings in image --- Dockerfile.gpu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index 9a53688..455e7ef 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -23,7 +23,11 @@ COPY src ./src COPY real_benchmarks ./real_benchmarks COPY scripts ./scripts COPY run_gpu.py ./run_gpu.py -RUN chmod +x /app/scripts/test_gpu.sh + +# Windows checkouts can provide CRLF shell scripts. Normalize inside the Linux image +# as a second line of defense in addition to .gitattributes. +RUN sed -i 's/\r$//' /app/scripts/test_gpu.sh \ + && chmod +x /app/scripts/test_gpu.sh RUN mkdir -p /cache /app/lfm-artifacts /app/gpu-reports From 65a345b7c3340ccd4fe04636d304b48ea6ea46b6 Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 15:09:57 +0200 Subject: [PATCH 5/7] fix: keep named CPU/GPU images buildable by Compose --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b2ed04a..3b909c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ services: test-cpu: profiles: ["cpu"] + image: dflash-mini-lab-test-cpu:latest build: context: . dockerfile: Dockerfile.cpu @@ -41,6 +42,7 @@ services: test-gpu: profiles: ["gpu"] + image: dflash-mini-lab-test-gpu:latest build: context: . dockerfile: Dockerfile.gpu From 5f7f3bd85574a14d80a63620fd7304c9a3f4e517 Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 15:10:35 +0200 Subject: [PATCH 6/7] test: guard Windows CRLF and named image build config --- .github/workflows/gpu-static-check.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gpu-static-check.yml b/.github/workflows/gpu-static-check.yml index a734750..d27bd67 100644 --- a/.github/workflows/gpu-static-check.yml +++ b/.github/workflows/gpu-static-check.yml @@ -3,6 +3,7 @@ name: CPU/GPU direct-runner static check on: pull_request: paths: + - ".gitattributes" - "Dockerfile.cpu" - "Dockerfile.gpu" - "docker-compose.yml" @@ -18,6 +19,7 @@ on: push: branches: [main] paths: + - ".gitattributes" - "Dockerfile.cpu" - "Dockerfile.gpu" - "docker-compose.yml" @@ -77,14 +79,25 @@ jobs: cmp mock-release/lfm_aux.pt mock-downloaded/lfm_aux.pt cmp mock-release/lfm_dspark.pt mock-downloaded/lfm_dspark.pt - - name: Validate GPU shell entrypoint - run: bash -n scripts/test_gpu.sh + - name: Validate Linux shell entrypoint and line endings + run: | + bash -n scripts/test_gpu.sh + python - <<'PY' + from pathlib import Path + data = Path('scripts/test_gpu.sh').read_bytes() + assert b'\r\n' not in data, 'scripts/test_gpu.sh must be LF, not CRLF' + assert data.startswith(b'#!/usr/bin/env bash\n') + PY + grep -Fq '*.sh text eol=lf' .gitattributes + grep -Fq "sed -i 's/\\r$//' /app/scripts/test_gpu.sh" Dockerfile.gpu - name: Validate Docker Compose CPU and GPU services run: | docker compose --profile cpu --profile gpu config -q docker compose --profile cpu config --services | grep -qx test-cpu docker compose --profile gpu config --services | grep -qx test-gpu + docker compose --profile cpu config | grep -Fq 'image: dflash-mini-lab-test-cpu:latest' + docker compose --profile gpu config | grep -Fq 'image: dflash-mini-lab-test-gpu:latest' - name: Verify zero-install Docker paths run: | From d293b64b6e085ffd798390e3e6f41406470fc19b Mon Sep 17 00:00:00 2001 From: Vahid Tavakkoli Date: Mon, 7 Sep 2026 15:10:43 +0200 Subject: [PATCH 7/7] chore: enforce LF for shell and Docker files --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 618e6ec..795b99b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# Keep Linux shell scripts executable with Unix line endings even when cloned on Windows. +# Keep Linux shell scripts and container files on Unix line endings even when cloned on Windows. *.sh text eol=lf Dockerfile* text eol=lf *.yml text eol=lf