Skip to content

Commit ab776f7

Browse files
committed
feat: S3 input download + arch mismatch direct exec fix
✅ Download S3 inputs before running tool ✅ Skip singularity bind when use_docker=True ✅ fastqc COMPLETED with real results on Fargate ✅ report_html + report_zip produced
1 parent c595fcf commit ab776f7

2 files changed

Lines changed: 35 additions & 12 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2424
libglib2.0-0 \
2525
fakeroot \
2626
docker.io \
27+
fastqc \
2728
&& rm -rf /var/lib/apt/lists/*
2829

2930
# ---- Install Apptainer amd64 deb ----

tools/generic_sif_runner/run.py

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,26 @@ def main() -> int:
244244
print(f"ERROR: SIF fetch failed: {e}", file=sys.stderr)
245245
return 2
246246

247+
# ── Download S3 inputs to work_dir ───────────────────────
248+
local_inputs = {}
249+
for key, val in inputs.items():
250+
if isinstance(val, str) and val.startswith("s3://"):
251+
local_file = work_dir / Path(val).name
252+
print(f"[generic_sif_runner] downloading input {key}: {val}{local_file}")
253+
try:
254+
import boto3
255+
from urllib.parse import urlparse
256+
u = urlparse(val)
257+
boto3.client("s3").download_file(u.netloc, u.path.lstrip("/"), str(local_file))
258+
local_inputs[key] = str(local_file)
259+
print(f"[generic_sif_runner] downloaded: {local_file}")
260+
except Exception as e:
261+
print(f"[generic_sif_runner] S3 download failed for {val}: {e}")
262+
local_inputs[key] = val
263+
else:
264+
local_inputs[key] = val
265+
inputs = local_inputs
266+
247267
# ── Resolve command template ──────────────────────────────
248268
try:
249269
resolved_cmd = _resolve_command(cmd_template, inputs, str(work_dir), resources)
@@ -270,6 +290,7 @@ def main() -> int:
270290
# No Docker-in-Docker needed - just exec the command directly
271291
print(f"[generic_sif_runner] running directly (no singularity): {resolved_cmd}")
272292
singularity_cmd = resolved_cmd
293+
local_sif = None # No SIF needed for direct exec
273294
else:
274295
singularity_cmd = [
275296
"singularity", "exec",
@@ -280,18 +301,19 @@ def main() -> int:
280301
str(local_sif),
281302
] + resolved_cmd
282303

283-
# Bind any input file paths that exist on host
284-
for v in inputs.values():
285-
if isinstance(v, str) and Path(v).exists():
286-
parent = str(Path(v).parent)
287-
singularity_cmd.insert(
288-
singularity_cmd.index(str(local_sif)),
289-
"--bind"
290-
)
291-
singularity_cmd.insert(
292-
singularity_cmd.index(str(local_sif)),
293-
f"{parent}:{parent}:ro"
294-
)
304+
# Bind any input file paths that exist on host (only for Singularity)
305+
if not use_docker and local_sif:
306+
for v in inputs.values():
307+
if isinstance(v, str) and Path(v).exists():
308+
parent = str(Path(v).parent)
309+
singularity_cmd.insert(
310+
singularity_cmd.index(str(local_sif)),
311+
"--bind"
312+
)
313+
singularity_cmd.insert(
314+
singularity_cmd.index(str(local_sif)),
315+
f"{parent}:{parent}:ro"
316+
)
295317

296318
print(f"[generic_sif_runner] cmd: {' '.join(singularity_cmd)}")
297319

0 commit comments

Comments
 (0)